Skip to content

Commit

Permalink
Padding (#58)
Browse files Browse the repository at this point in the history
change README
  • Loading branch information
SergeyBel authored Feb 4, 2022
1 parent b67a817 commit a8070f0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ C++ AES(Advanced Encryption Standard) implementation
unsigned char plain[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; //plaintext example
unsigned char key[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; //key example
unsigned int plainLen = 16 * sizeof(unsigned char); //bytes in plaintext
unsigned int outLen = 0; // out param - bytes in сiphertext

AES aes(AESKeyLength::AES_128); ////128 - key length, can be 128, 192 or 256
c = aes.EncryptECB(plain, plainLen, key, outLen);
//now variable c contains outLen bytes - ciphertext
c = aes.EncryptECB(plain, plainLen, key);
//now variable c contains plainLen bytes - ciphertext
...
```
Or for vectors:
Expand Down

0 comments on commit a8070f0

Please sign in to comment.