AES with C

Welcome everybody again!

This week is a cryptographic period and I want to present again AES.

AGAIN?!? Ok… I can understand your concern. Already in the last week I gave you a very similar program in Java. But there was something that bothers me.

When I want to protect something, I want to be able to protect everything. With Java I was quite happy to be able to encrypt any type of language (Chinese, Russian, Italian, Arabic, and so on). But it was not enough for me. I didn’t want only to encrypt simple text files, but even pictures, video or more complicate files.

AESC
A simple example of how to use this new program

For this reason I recover an old friend called C and I went brutally on the basis of the file code. To overcome the simple letter structure as ‘A’, ‘b’ or ‘胡’ and transcend in the fantastic world made of zeros and one, i.e. something like this 10101010101.

I am happy thus to make you available a new program in C, downloadable without any problem by here.

AES-128, AES-192 and AES 256, this time in C

Which are the advantages of this version?
+  You can encrypt (and decrypt) any files.
+  It it faster than Java
+  It works fine in Linux too (here the download for Linux version)

Which are the disadvantages?
–  The application is not user friendly (you need to use the terminal)
–  It is a little harder to select the file that you want to encrypt (or decrypt)

Give a try! But be careful! I will give you the same alert of the last time. If you encrypt a file and you delete the original one (DON’T DO IT), then you can recover your original document only if you own the password. I can’t accept any responsibility or liability for damages arising from the misuse of this program.

Your sincerely,
Stefano Martin

Share This:

AES with Java

Welcome everybody!

Today I want to show a new Java created by myself. It is useful in the case that you want to protect your messages from possible eavesdropper. If you like stories of espionage, the names of Snowden and Wikileaks will not sound new to you. In both the cases the protection or discovery of a secret were the main point of the debate.

When we want to protect our message we are doing “cryptography”.

In general, when we want to protect our message we are doing “cryptography”. At the contrary, if we want to discovery a message (without a password) we are doing “cryptanalysis”. With the java program that you can download from the next link, we are doing “cryptography”.

AES-128, AES-192, and AES-256 in one program

With this program you will be able to encrypt and decrypt text files (not photos, programs or videos) with one of the most secure method of encryption: AES-256 (or alternatively AES-128 or AES-192).

EncDecAES

To create this Java program I used the original paper that the authors, Joan Daemen and Vincent Rijmen, used to propose Rijndael, better known as AES. At this link you can find the original pdf.

For the creation of this program I found two interesting problems: the first one was of mathematical nature. To work with a field with 256 elements, called GF(256), is not simple and required some notion of not trivial algebra. Especially if you don’t understand that he chosen “x” in GF(256) is not a primitive element, but “x+1” it is. Luckily my PhD came to help me, and the creation of a the encryption systems was not really hard for myself. The use of Sage (Python with mathematical steroids) was fundamental to create efficiently this mathematics part.  If you don’t understand the problem, don’t worry! And be happy!

This is a good friend for a programmer that wants to use mathematics.

The second problem was with the implementation of AES. By having a Chinese wife and being myself Italian, I should use symbols as “我” or “é”. For this reason I should say goodbye to my old friend UTF-8 and say welcome to UTF-16 and its UNICODE world. It was not really challenging, but still interesting.

Give a try! But be careful! If you encrypt a file and you delete the original one (DON’T DO IT), then you can recover your original document only if you own the password. I can’t accept any responsibility or liability for damages arising from the misuse of this program.

Your sincerely,
Stefano Martin

 

Share This: