Encrypted bytes in Hex?

Discussion related to AES Crypt, the file encryption software for Windows, Linux, Mac, and Java.
Post Reply
Posts: 1
Joined: Thu Feb 18, 2016 3:53 am

Encrypted bytes in Hex?

Post by bshetty »


I would like to use the AES Crypt for encrypting the data and would like to get the encrypted data in "hex" format rather than in unicode (UTF-8) format.
Lets say that I have a bytes "90909090909090909090909090909090" i.e. of 16 bytes in hex(32 chars, each char takes 1 nibble when you load into memory). After encrypting i should get the same number of bytes i.e. 16bytes (32 chars). and I would like to get that out of encrypted bytes in "hex or binary" form. Is it possible to get it that way?

Appreciate your help!!

User avatar
Posts: 559
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA

Re: Encrypted bytes in Hex?

Post by paulej »

AES Crypt is designed for encrypting files, not memory. That said, I did publish a library in C for encrypting strings using version 0 of the file format. The output is slightly larger than the original file, but predictable.

You could just use AES without the stuff that makes AES Crypt unique and encrypt 16 octets and get 16 octets back. However, once you go beyond 16 octets, you are crossing to new cipher blocks and you have to take care not to inadvertently leak information or provide hints about the data being encrypted. For example, if you take a given AES key and encrypt those 16 octets, you will get some output "C". If the next 16 octets were the same values, you'll get the same value " C" again.

AES Cravoids that by using CBC mode. You'd need to do something similar, but your question is really outside the scope of AES Crypt or this forum.
Post Reply