# Basic 6: Decrpyt an encryption

Sam has got a lot wiser, he understood that a password if encrypted is a lot difficult to crack. But like every other time he made a mistake. He used such an encryption system that is publically available and is not good enough. Well, the rest of the hack is a lot easier as we have already got the encrypted password ‘a6c;459?‘.

Network Security Sam has encrypted his password. The encryption system is publically available and can be accessed with this form.

So, as we can see we now have an encryption machine, lets see how it works by entering a random number say ‘111111‘ and what happens next is it gets converted into ‘123456‘. As we see their is an some increment in each digit depending on its position. Lets try entering a string say ‘ABCDEF‘ and look we get the answer is ‘ACEGIK‘, with the same logic being followed.

This level does not require any kind of programming knowledge, but it surely helps if you have some. The decryption and encryption is simple in this case, with just little calculations. Hope you are good enough to do that.

Note: In case you have trouble decrypting ‘?’ or ‘;’ try learning about ASCII codes. In computer each character and number is denoted by a specific ASCII code ranging from 0 to 255. And in this case ASCII codes are being used to do the encryption. You can read and learn more about them by googling them.

### What did we learn?

-When you are to create a password avoid using publically available encryption and decryption system.
-ASCII codes which define each character to the computer machine in a number are important enough too be learnt.

Good luck!!!

## 3 Replies to “Basic 6: Decrpyt an encryption”

1. gaurav says:

how to get the encrypted password..as a tried by changing the email addres it says invalid referer…

1. You have to decrypt the existing password 9855f>9; with the encryption algorithm.

2. vedasree says:

//type this code to get the answer
#include

int main()
{
int i, x;
char str[100];

gets(str);

printf(“1 = Encrypt the string.\n”);
printf(“2 = Decrypt the string.\n”);
scanf(“%d”, &x);

//using switch case statements
switch(x)
{
case 1:
for(i = 0; (i < 100 && str[i] != '\0'); i++)
str[i] = str[i] + i;

printf("\nEncrypted string: %s\n", str);
break;

case 2:
for(i = 0; (i < 100 && str[i] != '\0'); i++)
str[i] = str[i] – i;

printf("\nDecrypted string: %s\n", str);
break;

default:
printf("\nError\n");
}
return 0;
}