vermarajeev
26th April 2007, 04:38
Hi All,
This is just to make clear some of the concepts used for encrypting and decrypting a file.
I use crypto++ lib for reference.
Some of common questions:
1) What is a 'seed' in cryptography?
2) I have a plain text file with size say '20kb'. When I encrypt the file the file size is increased. Why?
3) crypto++ provides alogorithms to encrypt and decrypt the files. To either encrypt and decrypt we need to write some logic which can make use of algorithms.
Consider for example I have this code snippet
string EncryptString(const char *instr, const char *passPhrase)
{
string outstr;
DefaultEncryptorWithMAC encryptor(passPhrase, new HexEncoder(new StringSink(outstr)));
encryptor.Put((byte *)instr, strlen(instr));
encryptor.MessageEnd();
return outstr;
}
string DecryptString(const char *instr, const char *passPhrase)
{
string outstr;
HexDecoder decryptor(new DefaultDecryptorWithMAC(passPhrase, new StringSink(outstr)));
decryptor.Put((byte *)instr, strlen(instr));
decryptor.MessageEnd();
return outstr;
}
Now in the above code there is logic to encrypt and decrpt a string.
1) Suppose there is a hacker who knows the passpharse of string and even know what alogorithm was used to encrypt it ( DefaultEncryptorWithMAC in above case). Is it possible for the hacker to decrypt the string with above information(only passpharse and algorithm used) ?
2) What do I call the logic part written above in technical terms? Suppose I want to explain my peers about how I used the logic to encrypt and decrypt the files. Is this what you call 'seed'?
3) I will encrypt a file with say AES::CBC mode and use passpharse 'hello123'. Now I have a friend in Poland whom I send the file by an attachment. I even reveal my passpharse and algorithm used (AES::CBC) but not the logic I have written to encode. Is it possible for my friend to decrypt the file using crypto++ lib?
The above questions might sound stupid so please bear with me?
Thanks
This is just to make clear some of the concepts used for encrypting and decrypting a file.
I use crypto++ lib for reference.
Some of common questions:
1) What is a 'seed' in cryptography?
2) I have a plain text file with size say '20kb'. When I encrypt the file the file size is increased. Why?
3) crypto++ provides alogorithms to encrypt and decrypt the files. To either encrypt and decrypt we need to write some logic which can make use of algorithms.
Consider for example I have this code snippet
string EncryptString(const char *instr, const char *passPhrase)
{
string outstr;
DefaultEncryptorWithMAC encryptor(passPhrase, new HexEncoder(new StringSink(outstr)));
encryptor.Put((byte *)instr, strlen(instr));
encryptor.MessageEnd();
return outstr;
}
string DecryptString(const char *instr, const char *passPhrase)
{
string outstr;
HexDecoder decryptor(new DefaultDecryptorWithMAC(passPhrase, new StringSink(outstr)));
decryptor.Put((byte *)instr, strlen(instr));
decryptor.MessageEnd();
return outstr;
}
Now in the above code there is logic to encrypt and decrpt a string.
1) Suppose there is a hacker who knows the passpharse of string and even know what alogorithm was used to encrypt it ( DefaultEncryptorWithMAC in above case). Is it possible for the hacker to decrypt the string with above information(only passpharse and algorithm used) ?
2) What do I call the logic part written above in technical terms? Suppose I want to explain my peers about how I used the logic to encrypt and decrypt the files. Is this what you call 'seed'?
3) I will encrypt a file with say AES::CBC mode and use passpharse 'hello123'. Now I have a friend in Poland whom I send the file by an attachment. I even reveal my passpharse and algorithm used (AES::CBC) but not the logic I have written to encode. Is it possible for my friend to decrypt the file using crypto++ lib?
The above questions might sound stupid so please bear with me?
Thanks