Initial and Final Permutation
Each Permtation takes a 64-bit input and permutes them according to a predefined rule.
It follows the Initial Permutation table . The table is fixed so meaning to say the 58th Bit will become the 1st Bit, 50th Bit becomes the 2nd bit, 42th Bit become the 3rd bit, so on and so forth.
For the Final Permutation, It follows the Final Permutation Table which is as follows:
In this case the 40th Bit become the 1st Bit, the 8th bit becomes the 2nd bit, 48th bit becomes the 3rd bit.
Lets take an example of a Plaintext: 123456ABCD132536
We will apply initial permutation to it.
Firstly the plain text is in HEX. We have to convert it to binary.
1 = 0001 2 = 0010 3=0011
4 = 0100 5= 0101 6=0100
7 = 0111 8 = 1000 9 = 1001
A = 1010 B = 1011 C = 1100
D = 1101 E = 1100 F = 1111
Therefore 123456ABCD132536 converted to binary would be
0001 0010 0011 0100 0101 0100 1010 1011 1100 1101 0001 0011 0010 0101 0011 0100
16 x 4 bits each = 64 bits.
1st bit = 0
2nd bit = 0
3rd bit = 0
4th bit = 1
5th bit = 0
6th bit = 0
7th bit = 1
8th bit = 0
and so on...
Now we map the bits into the first permutation table
we will get :
in this case the 58th bit is a 1 so
we place the 0 in the first bit position
next we look at the 2nd bit which is suppose to be fitted with value of the 50th bit which is also a 0
now the 3rd bit is to be fited by value from the 42th bit which has the value of 0
the 4th bit is to be fitted by value from the 34th Bit which is suppose to be the value of 1
0001
and we carry on with the rest ..
0001 0010 0011 0100 0101 0110 1010 1011 1100 1101 0001 0011 0010 0101 0011 0110
Converted To :
0001 0100 1010 0111 1101 0110 0111 1000 0001 1000 1100 1010 0001 1000 1010 1101
and now we convert this back to HEX using the table above where
0001 = 1
0100 = 4
1010 = A
0111 = 7
and so we will end up with
14A7D67818CA18AD
We will do the Final Permutation after the 16 rounds of Feistel Encryption.
Data Encryption Standard Algorithm
The DES algorithm is based on Feistel ciper.
The Encryption Process Follows three stages:
Step 1
Given a 64-Bit Plaintext P, DES first applies a fixed initial permutation (IP) to P to obtain P0 = IP(P). Express Po = Lo Ro (L for left , R for right) where L0 is the first 32 bits of P0 and Ro is the last 32 bits of Po.
Step 2
Next it will follow a 16 rounds of Feistel Encryption
Li = Ri-1
Ri = Li-1 XOR f(Ri-1,Ki)
Ki referes to the 48bit key obtain from the key K and f is the Feistel Function.
It is ok that it sounds messy to you at this stage, we will look into it in the next post.
Step 3
Switch Left and RIght to obtain R16L16 then apply the inverse permutation to obtain the ciphertext c=IP-1(R16L16).
The initial and final permutation is called P-Boxes.
It is ok that you will ask me, what are you talking about!!??? Don't worry. I asked that question when I first come over it. I will explain it later. =)
DATA ENCRYPTION STANDARD (DES)
The Data Encryption Standard (DES) is a symmetric-key block cipher published by the National Institute of Standards and Technology.
Today NIST has recommand the use of Triple DES as well as Advance Encryption Standard(AES) as DES which was published in January 1977 is no longer secure.
DES is a block cipher. It takes in 64-bit plaintext and creates a 64-bit ciphertext on the Encryption Side. It takes a 64-bit ciphertext and create a 64-bit plaintext on the decryption side.
The same key of a 56-bit cipher key is used for encryption and decryption.
Encryption is the process of changing a plaintext(a clear message) into a Ciphertext (Encrypted message)
Decryption is the process of changing a Ciphertext into a plaintext.
Cryptography is the art and science of keeping message secure. It can be known as cryptology or cryptanalysis too.
An encryption function can be represented as E[P] = C
where E stands for Encryption , P Stands for Plaintext and C stands for Ciphertext
In the reverse process, the decryption function can be represented as D[C] = P
where D stands for Decryption, C stands for Ciphertext and P stands for Plaintext
There are 2 general type of key-based algorithms : Symmetric Algorithm and public key algorithms.
The Symmetric Algorithm also known as symmetric Encryption is one that uses a Single key. Other names that are commonly used are secret-key encryption , one key encryption or conventional encryption. This algorithm uses the same key (a single secret key) for both encryption and decryption.
Both the sender and receiver will have to agree on a key before they communicate. An illustration would be the sender lock up a box with a number lock and only the receiver can open it as he knows the key to the lock.
The Public-Key algorithm also known as public-key encryption or asymmetric-key encryption. Each user in this case has two keys instead of one. One is a public key and One is a private key.
The public key is known to everyone which is being hosted on a public key server. The plaintext is first, encrypted using the public key of the receiver and sent to the intended recipient. Upon receiving the message, the receiver decrypt the message using his own Private Key which only he himself knows what it is. The Ciphertext encrypted by the public key of the receiver can only be opened by the Private key of the receiver. It cannot be decrypt with the same Public Key used to encrypt the message.
The different types of Security Attacks that concern Encryption Includes :
Eavesdropping
Eavesdropping is when an attacker(unauthorised person) read contents of a message that is passed from one party to another intended party.
For example , Tom is sending an email to Jess, and Jason(the attacker) reads the contents and know what Tom is sending Jess. This can be dangerous as what Tom is sending could be confidential. It could include some stuffs which only Jess should be told off. In this case, Jason is performing Eavesdropping by reading contents of the message when he is authorised to do so.
Modification of Messages
Modification of Message happens when an attacker(unauthorised person) change the contents of a message that is passed from one party to another intended party.
For example, Tom is sending an email to Jess, and Jason(the attacker) changes the contents of the message Tom is sending Jess.
The original message from Tom to Jess could be "Transfer 10 Thousand USD into Account number 123-456-789 "
However after Jason changes the contents when he is not authorised to do so, the message could end up to be "Transfer 10 Thousand USD into Account number 999-888-777"
This could end up to be a serious matter.
In Encryption, we will be dealing with the 3 Security Services which will deal with the Security Attacks mentioned above.
Confidentiality - Keeping information Secret, not to be read by a third party
Integrity - Keeping information intact, not to be changed by unauthorized persons
Availability - Making information available to authorized persons.
Eavesdropping
Eavesdropping is when an attacker(unauthorised person) read contents of a message that is passed from one party to another intended party.
For example , Tom is sending an email to Jess, and Jason(the attacker) reads the contents and know what Tom is sending Jess. This can be dangerous as what Tom is sending could be confidential. It could include some stuffs which only Jess should be told off. In this case, Jason is performing Eavesdropping by reading contents of the message when he is authorised to do so.
Modification of Messages
Modification of Message happens when an attacker(unauthorised person) change the contents of a message that is passed from one party to another intended party.
For example, Tom is sending an email to Jess, and Jason(the attacker) changes the contents of the message Tom is sending Jess.
The original message from Tom to Jess could be "Transfer 10 Thousand USD into Account number 123-456-789 "
However after Jason changes the contents when he is not authorised to do so, the message could end up to be "Transfer 10 Thousand USD into Account number 999-888-777"
This could end up to be a serious matter.
In Encryption, we will be dealing with the 3 Security Services which will deal with the Security Attacks mentioned above.
Confidentiality - Keeping information Secret, not to be read by a third party
Integrity - Keeping information intact, not to be changed by unauthorized persons
Availability - Making information available to authorized persons.
As we all know. Information Technology has been affecting humans life. We no long have to queue up at banks to bank in money (Automated banking machines) replaced human. In current world, we don't even need to go to an ATM to transfer money to a third party. All we need to do is logging onto Internet Banking and pass the information to the bank server allowing it to carry out the transaction to us. How do we know if the information we passed through the Internet is safe?
Information is a precious asset. We need to protect and safeguard it unauthorized persons , keep the information intact so that it could not be changed without our permission and making the information available to authorized persons when needed.
Security of information can be threatened by security attacks. An attacker can try to read the message being passed through the Internet, the attacker could try to modify the message, impersonates somebody or repeat a message which was sent previously.
On a not so seriously note, lets me tell you a little joke about it.
There was a guy that went on a holiday and he went to the beach and saw a hot girl there, he decide to tell his wife about it.
"Honey, I went to the beach and I saw lots of hot people. Somehow I wish you are here."
Some attacker decide to attack his message and did a modification by removing the last alphabet from his message.
The message his wife received ended up to be
"Honey, I went to the beach and I saw lots of hot people. Somehow I wish you are her. "
A simple attack like this changes the whole message and this might will make things messy. =)
Information is a precious asset. We need to protect and safeguard it unauthorized persons , keep the information intact so that it could not be changed without our permission and making the information available to authorized persons when needed.
Security of information can be threatened by security attacks. An attacker can try to read the message being passed through the Internet, the attacker could try to modify the message, impersonates somebody or repeat a message which was sent previously.
On a not so seriously note, lets me tell you a little joke about it.
There was a guy that went on a holiday and he went to the beach and saw a hot girl there, he decide to tell his wife about it.
"Honey, I went to the beach and I saw lots of hot people. Somehow I wish you are here."
Some attacker decide to attack his message and did a modification by removing the last alphabet from his message.
The message his wife received ended up to be
"Honey, I went to the beach and I saw lots of hot people. Somehow I wish you are her. "
A simple attack like this changes the whole message and this might will make things messy. =)
Welcome to Cyptography and Network Security. This site is to give a basic knowledge based information for daily users of the Internet. What do you really know about Data Security? How secured is your information passed through networks? Are you an online banking user? Doing online trading? Do you know how your data is being protected?
This site gives a basic introduction. The areas covered will include Data Encryption Standard (DES), Advanced Encrpytion Standard(AES), Public Key Encryption(PKE), Sucure Hash Funtion(SHA-512) and other userful information. Message Authentication, Secure Socket Layer and Secure Electronic Transaction will also be discussed in this site.
I hope the knowledge sharing is good enough and I welcome comments.
This site gives a basic introduction. The areas covered will include Data Encryption Standard (DES), Advanced Encrpytion Standard(AES), Public Key Encryption(PKE), Sucure Hash Funtion(SHA-512) and other userful information. Message Authentication, Secure Socket Layer and Secure Electronic Transaction will also be discussed in this site.
I hope the knowledge sharing is good enough and I welcome comments.