Xor-el / CryptoLib4Pascal

Crypto for Modern Object Pascal
MIT License
209 stars 63 forks source link

Example with CryptoJS AES #27

Closed lainz closed 3 years ago

lainz commented 3 years ago

Hi, there's a JavaScript library called CryptoJS, that supports several algorithms.

If possible, you can add a simple example, on how to decrypt using your library?

CryptoJS https://cryptojs.gitbook.io/docs/#the-cipher-algorithms

var encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase");
​
var decrypted = CryptoJS.AES.decrypt(encrypted, "Secret Passphrase");

CryptoJS supports AES-128, AES-192, and AES-256. It will pick the variant by the size of the key you pass in. If you use a passphrase, then it will generate a 256-bit key.

I asked in the forum for help, but didn't find a good response, googling I found your packages.

Here is more information https://forum.lazarus.freepascal.org/index.php/topic,54581.0.html

And sample code in Java that does the thing.

Thanks and have a nice day.

lainz commented 3 years ago

Hi, I will close this since I understand I must learn cryptography basics first, else my job can be done wrong and it will be my fault in the end, so better I will try to get a better idea of cryptography.

Seems that almost everything is in the samples, I do the same with BGRAControls, so I understand.

Thanks and have a nice day.