Skip to content

Commit 94acec5

Browse files
authored
Update README.md
1 parent 2cf67d2 commit 94acec5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,21 @@ unsigned char plain[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
1212
unsigned char key[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; //key example
1313
unsigned int plainLen = 16 * sizeof(unsigned char); //bytes in plaintext
1414

15-
AES aes(AESKeyLength::AES_128); ////128 - key length, can be 128, 192 or 256
15+
AES aes(AESKeyLength::AES_128); // 128 - key length, can be 128, 192 or 256
1616
c = aes.EncryptECB(plain, plainLen, key);
17-
//now variable c contains plainLen bytes - ciphertext
17+
// now variable c contains plainLen bytes - ciphertext
1818
...
19+
delete[] c;
1920
```
2021
Or for vectors:
2122
```c++
2223
...
23-
24-
2524
vector<unsigned char> plain = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; //plaintext example
2625
vector<unsigned char> key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; //key example
2726
2827
AES aes(AESKeyLength::AES_128);
2928
c = aes.EncryptECB(plain, key);
30-
//now vector c contains ciphertext
29+
// now vector c contains ciphertext
3130
...
3231
```
3332
ECB, CBC, CFB modes are supported.

0 commit comments

Comments
 (0)