kokke/tiny-AES-c

Crypto AES128 CBC in String Text

Mauricio-Alencar opened this issue · 2 comments

I don't know if this would be the right place to answer a question, but come on. I have an example String:

"Test crypto using AES128 CBC"

So, I know that the steps are> convert ASCII characters to hexadecimal bytes> Maybe fill the buffer if it is not 64 bytes with some character (here is my main doubt) and then encrypt using lib. Can anyone there help me with these steps giving an example in C being executed ??

kokke commented

Hi @Mauricio-Alencar and thanks for your interest in this project :)

You have understood correctly that AES-CBC works with blocks of size 128bit/16byte.

I am unsure that I understand what you mean by this sentence:

convert ASCII characters to hexadecimal bytes

... but yes you will need to treat data as if it is binary.

Padding is a subject of its own, but as stated in the readme, I recommend the PKCS7 standard as described in:
https://en.m.wikipedia.org/wiki/Padding_(cryptography)#PKCS7

I think the closest you will come to an example in this repo, is ‘test.c’

kokke commented

Closing for inactivity — feel free to keep writing if more questions arise :)