Link to home
Start Free TrialLog in
Avatar of zakirin
zakirin

asked on

How to implement Data Encryption Algorithms (DES) in C++

I would like to understand how the des(data encryption standard) algorithm run and then to write a program using C++ or C. Can someone help me with this ??
Thank you.
Avatar of zakirin
zakirin

ASKER

Edited text of question
ASKER CERTIFIED SOLUTION
Avatar of AlexVirochovsky
AlexVirochovsky

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't know exactly which algorithm you mean with DES...
Is PGP-encryption / description ok ?? (This is the encryption they use to send data between banks etc..)

Here's how PGP-encrypion /decription algorithm works

- Get 2 big prime numbers (with 100 digits or so)
  we calls these p and q
- n = p * q (rember this, we need this value)
  phi(p) = p - 1
  phi(q) = q - 1
  phi(n) = phi(p) * phi(q) = (p-1)*(q-1) (also remember phi(n))
- E is the encryption key,
  D is the decryption key..      
  (E*D) mod phi(n) = 1
- Now we are going to calculate the D (decryption key)
 
Sorry, I forgot this step, I need to search it in my Mathematics book at home...

- When you get the D, you can calculate the E, by solving this
  equation.
  E*D = 1 (mod phi(n)) note '=' must have three bars...

- The message(M) can be encoded this way:
     E
  (M)
  It can be decoded with:
     D
  (M)
The big advantage of this method is that the description(D) can't be calculated (very fast, more then a few hundred years with a LOT of fast computers).

Well I will give you another comment when I've got the book at home...
 



That is the DES algorythm.

>>The big advantage of this method is that the description(D) can't be
>> calculated (very fast, more then a few hundred years with a LOT
>> of fast computers).
Techniques have been developed to break this system using multiple computers.  A large key was broken in less than 3 months using 100 computers.  It is still a very good safeguard, but...
Avatar of zakirin

ASKER

Thanks a lot Alex.