I am new to CryptoPP. I am also new to cyptography and it sounds like you
may be too. I am using crypto++ to encrypt files on windows 7 systems. I
use AES in GCM mode. The functions cypography algorithms require a key,
that key can be randomly generated or you can provide it. I am using
crypto++ PKCS5_PBKDF1<SHA512> algorithm to generate my key from a password.
Here is the key code i am using. Please ignore the function name and the
fact I return it and set it to the provided param. The guts are what you
may want.
std::string CipherFunc::PBKDF1_DeriveKey(byte* _outkey, size_t
_outkeylength,const char* _passphrase, size_t _passphraselength,const byte
* _salt, size_t _saltlen, size_t _iterations){
PKCS5_PBKDF1<SHA512>fn;
size_t maxsize = fn.MaxDerivedKeyLength();
try{
fn.DeriveKey(_outkey,_outkeylength,0,(byte*)_passphrase,_passphraselength,_salt,_saltlen,_iterations,0);
}catch(Exception e){
//do something
}
std::string s((char*)_outkey);
return s;
}
If I am wrong in my use of this, I would please like someone else to
comment on this to help me out too.
Thanks
On Tuesday, February 19, 2013 2:56:11 AM UTC-5, Rajat Budhiraja wrote:
>
> Hello Everybody
>
> I am new to CryptoPP and intend to use the AES algorithm from it. I have
> downloaded and installed the Version 5.6.1 on a Linux machine. I found a
> sample AES program on Internet and got it to compile and execute
> successfully. But, this program is randomly generating keys; then
> encrypting and decrypting the data.
>
> My question is how to use specific values (e.g. "abcd" or "4567") as keys
> or use these to generate keys and encrypt the plain-text data (and, not use
> randomly generated keys), because I need to decrypt the data on the other
> end as well (and for that I need the key on the other end as well).
>
> Does Cryptopp AES supports this?
>
> Any help on this will be appreciated.
> I can share the sample program if needed.
>
> Thanks
>
--
--
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.
---
You received this message because you are subscribed to the Google Groups
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.