This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Mackan90096's profile picture

Caesar cipher API

Started by Mackan90096, 30 March 2015 - 09:46 AM
Mackan90096 #1
Posted 30 March 2015 - 11:46 AM
Here's an API for you.
This provides functionality to encode and decode caesar ciphers.

To download, run
 pastebin get L73wHypz Caesar

Documentation
SpoilerEncoding
Spoiler

os.loadAPI('Caesar') -- This loads the API

local data = Caesar.encrypt("Hello, World!", 12) -- This encodes the text "Hello, World!" with a 12 character rotation

print(data) -- Prints "Tqxxa, Iadxp!"


Decoding
Spoiler

os.loadAPI('Caesar') -- This loads the API

local data = Caesar.decrypt("Tqxxa, Iadxp!", 12) -- This decodes the text "Tqxxa, Iadxp!" with a 12 character rotation

print(data) -- Prints "Hello, World!"
Rougeminner #2
Posted 04 April 2015 - 05:35 AM
i don't think i have seen a computercraft ported Caesar Cipher i am shocked i didn't think of it my self. :D/> this will allow for an extra layer of encryption for my code.A simple on. but i will confuse the ones you try to crack it. Should work along a i don't to

Caeser.encrypt("Hello",26)
Creeper9207 #3
Posted 27 April 2015 - 07:10 PM
binary data of password as rotation times, Encryption! :D/>
Anavrins #4
Posted 04 May 2015 - 04:26 AM
binary data of password as rotation times, Encryption! :D/>
Very weak encryption :D/>
https://f00l.de/hacking/vigenere.php
Creator #5
Posted 06 May 2015 - 10:43 PM
I think there is AES fo CC. Now, let's talk about weak encryption.
Creeper9207 #6
Posted 10 May 2015 - 05:48 AM
its computercraft, not the national U.S. bank
binary data of password as rotation times, Encryption! :D/>
Very weak encryption :D/>
https://f00l.de/hacking/vigenere.php
I think there is AES fo CC. Now, let's talk about weak encryption.
Edited on 10 May 2015 - 03:49 AM
Anavrins #7
Posted 23 May 2015 - 04:16 AM
its computercraft, not the national U.S. bank
binary data of password as rotation times, Encryption! :D/>/>
Very weak encryption :D/>/>
https://f00l.de/hacking/vigenere.php
I think there is AES fo CC. Now, let's talk about weak encryption.
It's not the U.S. Bank, but those strong encryption are doable in CC, so "Why not"
biggest yikes #8
Posted 15 June 2015 - 12:22 AM
binary data of password as rotation times, Encryption! :D/>
Very weak encryption :D/>
https://f00l.de/hacking/vigenere.php
You're right, it is very weak, but it seems that none of the vigenere decrypting websites can decrypt anything to save it's life. I made a string encrypted with the key "z" and the one you linked thought it was 7 characters, another one thought it was 4.
Anavrins #9
Posted 15 June 2015 - 03:56 AM
binary data of password as rotation times, Encryption! :D/>
Very weak encryption :D/>
https://f00l.de/hacking/vigenere.php
You're right, it is very weak, but it seems that none of the vigenere decrypting websites can decrypt anything to save it's life. I made a string encrypted with the key "z" and the one you linked thought it was 7 characters, another one thought it was 4.
That's because a key of one character is generally considered a Caesar cipher, the site attempts to crack a message assuming the vigenere cipher is used (Key larger than one)
Longer messages also have more chance of successful decryption since it allows more letter frequency analysis, which is the key of breaking those ciphers.
biggest yikes #10
Posted 15 June 2015 - 04:41 PM
That's because a key of one character is generally considered a Caesar cipher
I guess that explains why the key "zz" is equivalent to "z"

It also seems like if a vigenere key contains a non-alphanumeric character (for example, an asterisk) most online crackers can't crack it
Edited on 15 June 2015 - 03:01 PM
SquidDev #11
Posted 15 June 2015 - 07:19 PM
I guess that explains why the key "zz" is equivalent to "z"

It also seems like if a vigenere key contains a non-alphanumeric character (for example, an asterisk) most online crackers can't crack it

How would you even encode with a non a-z vigenere key? Most primitive ciphers only work with the English alphabet.
Anavrins #12
Posted 15 June 2015 - 07:57 PM
I would guess an alternative would be to do the XOR operation, whatever if the byte value is a letter or not.
Edited on 15 June 2015 - 05:58 PM
biggest yikes #13
Posted 16 June 2015 - 03:59 PM
Just double checked, seems like the key "AB" is equivalent to "AB()". Huh. Maybe I need to learn more about this kind of stuff.
Edited on 16 June 2015 - 02:00 PM
Waitdev_ #14
Posted 15 July 2015 - 09:29 AM
idk really, if you want to encrypt something it can easily be decoded :/