Cryptography is the trending and a best way to provide security for your valuable data over the internet. what is cryptography you must be knowing but wait, have ever tried to see that how does it work over the internet and how are the algorithm design from which your data is been kept safe from hackers. Cryptography began when we started abandon physical locks and started using cipher think it as virtual lock. Cryptography is around 1000 years ago and it has decided wars and is at the heart of the world communication of network today.
Cryptography is the technique to secure your data using different techniques. Cryptography is all about mathematics i.e probability, permutation and combination. I’ll not about the whole theory of Cryptography, how does it works and what are different algorithms for it but one of the algorithm which I thought can be implemented for securing your data. Most of you must be knowing what is cryptography and how does it works.
A single key is used by the sender and the receiver for encryption and decryption of your data. Key can be send and receive by at both communication end by many ways i.e generating certificates, a call, third party secure medium, USB stick. There are two keys public key and private key. Public Key is used to transfer to each other and private key is kept at the owner which is not disclosed. There is relation between Public Key and Private Key so when sender and receiver send Public key then using the relation of private and public key authentication is done.
Armstrong Number and Color Codes
Security is a major challenge in today’s world. I have recently read a IEEE paper on Security using Armstrong Number and Color Codes which has many fault and can be improved and can be used in real time encryption and decryption of data. The Algorithm which I have provided over here is a cascaded encryption or multiple encryption. Those who don’t know Armstrong Number please go through this page.
First we will understand what the publisher had published and how their encryption and decryption algorithm works. In the very first phase of the research they talk of using Armstrong numbers and color code. They have written that we would be using color codes which has 2^24 possibility but their is major bug that they are using Armstrong Number which are very less in count i.e 5 0,1,153,407,370,371 in which we cannot use 0 and 1 and only rest of the four can be used which is has less possibility and can be cracked down within four attempts.
Second phase of paper talks about using a 3×3 matrix i.e use of color codes. Each color is made of Red,Blue and Green so making 3×3 matrix which has 16×16 row and cols for each matrix to store the no from 0-255 in each matrix. Every Sender and Receiver would have separate color code by which he would be generating a tuple and using it further for encryption by just x-xor to encrypt and store the data into a new matrix. Receiver would just use color code and inverse the matrix to get the data which I thought is not feasible because the whole encryption depends on the color code and if someone got the color code can get your data. The bug lies where there they have used those RGB tuple and added so the range of the numbers goes beyond 255 which not possible in color code. The have also talked about using permutation but I have not found them using it in the paper.
Modified Algorithm For Encryption
The best features of this algorithm is that it does not increases the size of the data which is impossible foe the hacker to know that is the data is encrypted or the data is corrupted. I have introduced three steps steps/level Encryption which means encryption to already encrypted data which is also called cascaded encryption or Multiple encryption. In First step/level of encryption, the sender and receiver will decide a key by which they will encrypt and decrypt the data. As I’m respecting the author of the paper so, I’m going to use Armstrong Numbers and Color Codes but with some new modification which will make the algorithm much secure to apply in real time cryptography. I have sum up the ASCII values of the key which gives me some value greater than ASCII range. Then I have created a base table array of 24 which will have the permutation of the Armstrong number. Sum of ASCII of key modulo 23 gives me a number between 0-23 from which we would select a element from the base table array which would have the permutation of the four Armstrong Number i.e 153,407,370,371.
After getting the permutation of the Armstrong Number than I have concatenated the ASCII sum at the end which brings the first level of the encryption. To generate First Key for encryption I have xor the data byte by byte with the generated Key not I have not increased the size of the data which is the best feature of the algorithm. In Second level of the encryption which is encrypting already encrypted data. I have generated a cube i.e having 3×3 matrix where each matrix will be of 16×16 of rows and cols which will have 0-255 number for Red, Blue and Green. The first cell of the matrix would have the ASCII of number of RGB of the color code then it would go to 255 and then again back to the ASCII-1 in each matrix. I generated the RGB color using Sum of ASCII of key + any sequence generated in the permutation modulo 256 which result in RGB color for the matrix and this is our second encryption of the data.
As second step of encryption is done, I have generated a nibble of 4 bit for row and 4 bit for cols. The data is encrypted twice so when I have generated a encrypted byte. By following above steps for each byte we can generate a encrypted file.
Modified Algorithm For Decryption
For decryption of the cipher text, well we just need to reverse the above encryption process. First the generation of sum of ASCII value of the key. Then cube generation which will give us the actual color code used while encryption. Using the RGB color code we just need to reverse the method of generating of nibble, which would give us our actual byte in result.
This method gives a significant way of using cryptography and I would suggest that rather than using armstrong number, we can use prime number. Next blog post would be using prime numbers and with some new modifications which would make more strong and which can used in real world problems.
If you like the post please share it and do comments what more modification need to be done in this algorithm, please share your view.