Speaking of which, how do I go about making my own encryption in C for ascii and bin files?
Speaking of which, how do I go about making my own encryption in C for ascii and bin files?
Start off with XOR encryption.
pseudo code:
or something like that.Code:string key = "monkey" string encryptme = "secretcode" string final int keylength = strlen(key) int keypos = 0 for (i = 0; encryptme[i] != '\0'; i++) { final[i] = encryptme[i] ^ key[keypos] keypos ++ if (keypos > keylength) { keypos = 0 } }
What is XOR?
I think just giving me a basic (general) english algorithm has to how I should go about making one would help me alot more.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Choose 2 large primes p and q
pick e>1 such that gcd(e,(p-1)(q-1))=1
Let n=pq
encoded symbol M as C=M^e mod n
solve ed=1 mod (p-1)(q-1) for d
Decode coded symbol C as M=C^d mod n
e and n are publicly announced so anyone can encode a message. All the other numbers are to be kept secret. p and q need to be 200+ digits if you're doing this for real life use. Google: RSA encryption, Fermat's little theorem, modular arithmetic, greatest common divisor algorithm, arbitrary precision arithmetic. books: abstract algebra.
Last edited by grady; 12-22-2003 at 01:11 PM.