<<Adrian: P and Q aren't generated, they're selected basically at
random, but remain constant for any one encription method. >>
MP0werd: Mind explaining the whole encryption method?
Adrian: I'll try. First you pick two very large prime numbers, call
one P and one Q. Next, multiply P & Q together to find n.
Adrian: Then find f(n) by the formula: f(n) = (P-1)(Q-1)
Adrian: Then pick any e and any d such that: ed = 1 mod f(n)
Adrian: Now to encrypt a number use the formula: f(x) = x^e mod n
where x is the number to encrypt. To decrypt use the formula: f(x)
= x^d mod n again x is the number to decrypt.
Adrian: You can turn characters into numbers anyway you like,
but I chose charToNum() because it's so easy. Then encrypted
each letter individually, but added the encrypted numbers in groups
of three. ie: Encrypt the first three letters and add the results
together, then encrypt the next three letters, add the results
together and append to the result of the last three. This adding
reduces the length of the resulting string to something reasonable,
without impacting on security too much (it does mean that there
may be two passwords with the same encrypted form, but it's still
almost impossible to find them.)
Adrian: Does this help? You will probably understand more when
you see the scripts.