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

Sort-of encryption algorithm I made up

Started by LDDestroier, 06 February 2016 - 02:10 AM
LDDestroier #1
Posted 06 February 2016 - 03:10 AM
I attempted to make a hashing algorithm that used no constants, and outputted a number instead of a string. Then I figured out that huge numbers return "nan". But it's still a bunch of numbers in a string.
I don't know if this is safe or not, or if it even can be called hashing (maybe it can be reversed?), so I'm just putting it on the forum and seeing if people can make an decrypt function or something.
It does work, however, no errors here (probably). MUST take two strings (message, key)

Pastebin: xn9Shvy6
DannySMc #2
Posted 23 February 2016 - 10:56 PM
As no one else has posted I think I will! :)/>/>

Anyway here is my thoughts, I like it a lot, it's an awesome idea and it's nice to see other people's versions on hashing etc.

A few notes:
- Letterize can only take up to 18 numbers otherwise it errors, I think this may be a Lua thing? As Lua does not like large numbers.
- Encrypt is very… bloated? The output string is HUGE compared to what it needs to be, but I don't think it's a bad thing?

Would you be able to put a way of file hashing? That would be amazing if you could pull out (Not massive, but fairly large) hashes of files? I am not sure if you can but I would love to see this, and even make an encrypt / decrypt function…?

But don't get me wrong this is really cool, it's nice and simple, no messing around.

Just one other question what are the letterize and unletterize actually for? I wasn't completely sure? I was just messing with it :P/>/>

Anyway nice one!!
Edited on 23 February 2016 - 09:57 PM
LDDestroier #3
Posted 13 March 2016 - 01:04 AM
Just one other question what are the letterize and unletterize actually for? I wasn't completely sure? I was just messing with it :P/>/>

Letterize takes a number (which is expected to be in a string format, like "13412785143852") and, for every two characters, adds a character from a string based on that. Unletterize just reverses that.

And as for the 'bloatedness,' YES! It is very bloated. That's kinda what I was trying to mitigate with the letterize function, which would halve it. But yeah, it does output a lot of characters.