US:+16362902365 & BD:+8801711573570

info@techgensolution.com

A Leading Web Development Company 

Sharing is caring!

When using the API, you need to be very careful about the length of the data. I was confused when I first used it. I made a note for this article. Generally there are no parameters of the specified length. The default is 16 ( AES_BLOCK_SIZE) bytes. The length of the output data is usually a multiple of 16 bytes, otherwise the array will be out of bounds.
In the following APIs, encrypt means encryption and decrypt means decryption.

1. Generate an encryption/decryption key

int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key);
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key);

2. Use AES encryption / decryption

void AES_encrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key);
void AES_decrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key);

3. Use AES CBC encryption/decryption

void AES_encrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key);
void AES_decrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key);

Sharing is caring!

Grab the latest deals on your inbox

Your email is safe ❤️ . I hate SPAM same as you!

Techgen IT Solution provides its clients with a variety of offshore business solutions like system design, .NET technology stack including C#, ASP.NET, MVC, Web API, SQL, Entity Framework, JavaScript and related technologies, namely AngularJS, Knockout, NodeJS etc

USA OFFICE

BD OFFICE 

© 2019 Techgen IT Solution. All Rights Reserved.

shares