.

Wednesday, February 1, 2012

[C++] Caesar Cipher (ASCII)

          Hello, Reader ^^! Back again with source code ^^! This time the source code is Caesar Cipher for ASCII. How it works it is still same with the Alphabet version. The only differences are this time it is not limited to alphabet anymore, but it is ASCII. Plus, the effective key is increased to 256 keys. Plus, with that, the formula for encryption is:

En(x) = (x + n) mod 256

While the formula for decryption is:

Dn(x) = (x - n) mod 256

For example, I use "HeLLo WoRlD!". I encrypt it with key = 122. It will be rotated into "ÂßÆÆéšÑéÌæ¾›". Okay, that's all I can say ^^! Thank you for reading ^^!










2 comments: