Javascript Crypto Elements:
RC4 encoding:
Demonstrates the RC4 encryption script, together with base64-type
encoding.
Functions used:
- rc4(key,string) -- symetric cypher -- encrypts and
decrypts
- textToBase64(text) -- text to base 64
- base64ToText(b64text) -- base to base 64
Source:
function rc4encrypt() {
document.rc4.text.value=textToBase64(rc4(document.rc4.key.value,document.rc4.text.value))
}
function rc4decrypt() {
document.rc4.text.value=(rc4(document.rc4.key.value,base64ToText(document.rc4.text.value)))
}
THIS JUST IN!!!
I have a working key generator and have totally rewritten the long-math
functions. See the results here!
Ignore the rest of this...
RSA-type:
Note that long keys will likely be slow. Let me know what size keys are
practical on your system...
Other...
I have working functions to generate n-bit primes and GCD. I'm working on
generateing RSA-type keys, but it's not all there yet. View the source
to see what is there.
More later.