You are not logged in.
hello everybody:
I need to use AES encryption, decryption, an example of a stream, who can give me a demo code ?
(Using TAESCBC )
Offline
var
cryptedPassword, rawPassword: RawByteString;
Key: TSHA256Digest;
begin
...
rawPassword := password;
SHA256Weak(MYSQL_PASSWORD_AESKEY, Key);
cryptedPassword := SynCrypto.AES(Key, 256, rawPassword, true);
password := BinToBase64(cryptedPassword);
...
end;
MYSQL_PASSWORD_AESKEY - string constrant containing aes key
Please try.
I hope it will be usefull.
Offline
thanks,
I need to encrypt and decrypt Tmemorystream, can you help me?
Offline
And pls keep in mind: SynCommons.pas and mORMot AES classes are not crossplatform.
Offline
And pls keep in mind: SynCommons.pas and mORMot AES classes are not crossplatform.
.... Under Delphi.
But working on Linux (and also Darwin/MacOsX) with FPC.
Offline
Thank you for your reply.
Sorry, I have not found TRawByteString , is it TSynMemoryStream ?
I would like to use "AES(CBC)", Is the use "TAESCBC" class ?
my code is :
....
clientdataset.SaveToStream(cds_st,dfBinary);
//encryption
Offline
TRawByteStringStream class - sorry for the typo.
After a SaveToStream() on this class, use TAESCBC on the DataString method, then create a TRawByteStringStream instance from the encrypted RawByteString.
Offline
Is there a method for :
stream(in) -->stream (out encryption) ?
Offline
Thank you very much.
Offline