--Originally published at Diego's Password
So in today’s class we saw some encryption algorithms which we needed to implement later on. After a hard time dealing with C string ASCII references, I finally could made them some algorithms work.
We saw Caesar’s and Vigenere’s ciphers. Both operate by changing a character certain number of positions based on an abecedary index. So if I have “abc” and I apply a key of 1, I’ll just move all the characters by one, giving back “bcd”. Thats how Caesar’s works.
For Vigenere’s it’s the same, but having a distinct key for each character of the string. These keys will be taken from another string, having each character of it as a numeric key.
Here’s what I came up with.