2217 posts
Location
3232235883
Posted 09 September 2012 - 11:47 PM
a basic encryption program for you lazy people
can encrypt: tables,strings,boolean,numbers,
functionsupdate history:
Spoiler
—1.0—
initial release
—1.1—
security update
found a huge hole in unserialization allowing functions to be run
—1.2—
security update
added more options to the checksum function, allowing for more secure password checkingusage:
encrypt(data,password)
decrypt(data,password) -- on error returns data,decoded,decoded checksum
checksum(string[,detail]) -- default for detail is 1
a really good way to use the checksum function is to store a checksum instead of a password, so you cant just open up a file to see a password
example:
Spoiler
40281018 is the result of checksum("password",1000)
shell.run("clear")
write("Pass: ")
input=read()
if enc.checksum(input,1000)==40281018 then
print("Access granted.")
else
print("Access denied.")
end
when the access is granted you can use the input to decrypt personal info :3all of the functions besided the ones listed above are part of my unreleased api so i just copied them in
pastebin:
http://pastebin.com/WRTfH0yxhow to use:
Spoiler
edit, use, redistribute but give credit
496 posts
Location
New Zealand
Posted 10 September 2012 - 01:59 AM
Doesn't work: abc_enc.lua:106: wrong number of arguments to 'insert'
table.insert(out,key[cnt][1],zfill(wrap(string.byte(char)+key[cnt][2])),chars)
Also the char variable there doesn't exist.
2217 posts
Location
3232235883
Posted 11 September 2012 - 04:11 PM
sorry, forgot to update it with the code in np++, sould work now
2217 posts
Location
3232235883
Posted 21 September 2012 - 01:44 AM
no responses? "works fine" is good enough
3790 posts
Location
Lincoln, Nebraska
Posted 21 September 2012 - 05:37 PM
I haven't had a need to encrypt anything, but if I do, I'll take a look at this here.
871 posts
Posted 22 September 2012 - 12:19 AM
pastebin version would be nice, and I'd try it out.
175 posts
Posted 26 September 2012 - 07:06 AM
What algorithm is this? I have a pure lua Arcfour implementation that I found on the net, might be useful.
2217 posts
Location
3232235883
Posted 29 September 2012 - 05:41 PM
i made it up by my self, basically it uses the bytes of the password as a random seed to add to the encoded outputs bytes and also shifts the characters around randomly, making it 10000x harder to brute force without the original program.
1604 posts
Posted 02 October 2012 - 12:26 AM
The code is still wrong, the error tomass said is not fixed.
You should test your code before posting it.
2217 posts
Location
3232235883
Posted 02 October 2012 - 03:33 AM
The code is still wrong, the error tomass said is not fixed.
You should test your code before posting it.
yes it does:
1604 posts
Posted 03 October 2012 - 02:02 AM
Well, the line is still wrong:
table.insert(out,key[cnt][1],zfill(wrap(string.byte(char)+key[cnt][2])),chars)
there's 4 arguments to the method, but it only takes 3. I wasn't testing in CC, it seems to ignore the extra argument there.
2217 posts
Location
3232235883
Posted 03 October 2012 - 02:42 AM
Well, the line is still wrong:
table.insert(out,key[cnt][1],zfill(wrap(string.byte(char)+key[cnt][2])),chars)
there's 4 arguments to the method, but it only takes 3. I wasn't testing in CC, it seems to ignore the extra argument there.
you must be using the one i posted before, not the one i uploaded to pastebin
line 106:
1604 posts
Posted 03 October 2012 - 02:47 AM
No, it's the one on pastebin. Line 114:
table.insert(out,key[cnt][1],zfill(wrap(string.byte(char)+key[cnt][2])),chars)
The ",chars" shouldn't be there.
But it works anyway, so no problem.
2217 posts
Location
3232235883
Posted 11 October 2012 - 10:36 PM
updated to 1.1, fixed some holes in unserialization allowing functions to be run, now you can feel completely safe when decoding rednet messages
also i uploaded the pastebin with an account so i dont have to keep updating the link
175 posts
Posted 12 October 2012 - 07:33 AM
Being a game, it's not all that important, but homebrewed encryption algorithms are usually not a tremendously great idea. :P/>/>
2217 posts
Location
3232235883
Posted 13 October 2012 - 06:56 AM
Being a game, it's not all that important, but homebrewed encryption algorithms are usually not a tremendously great idea. :)/>/>
actually with le hackcraft server all rednet messages are broadcasted so its pretty usefull
meh, its simpler than recoding a complex. popular encryption method :)/>/>
trust me, its safe and almost impossible to brute force
*starts working on a brute force program*'
but if you want it to be super secure you can store a random 256 char password on a floppy making it take literaly centurys to decode, while creating millions of false positives :3
EDIT:
made it, but it takes like 30 min just to hack a 6 char password 0_0
2217 posts
Location
3232235883
Posted 14 October 2012 - 08:01 AM
updated to 1.2
added some checksum stuffs, and a tutorial on how to make your login script secure :)/>/>
214 posts
Posted 16 October 2012 - 07:13 PM
Great code, just one tip. note i havn't read the pastebin version. but dont use shell.run("clear"). you want to avoid adding programs. instead use term.clear() this is a function in the built in api's of CC. just a tip
thanks -Cheeky
2217 posts
Location
3232235883
Posted 16 October 2012 - 07:48 PM
Great code, just one tip. note i havn't read the pastebin version. but dont use shell.run("clear"). you want to avoid adding programs. instead use term.clear() this is a function in the built in api's of CC. just a tip
thanks -Cheeky
yea, i know, i made a virus reinfect itself using programs that use shell.run
its an api so there is no point in clearing the screen
23 posts
Posted 11 February 2013 - 04:26 AM
This program is great. I will be implementing it in my program. I will give credit, of course.
249 posts
Location
In the universe
Posted 11 February 2013 - 05:59 AM
This program is great. I will be implementing it in my program. I will give credit, of course.
So there goes another topic revived…
82 posts
Posted 25 May 2013 - 11:36 AM
You should add another thing to the encrypt function like for the salt
126 posts
Posted 12 August 2013 - 11:09 AM
How do I store the encrypted data? I mean I don't really get what to do with the number and string thing I get when I encrypt something. Storing as a string does not work.
Derpy me :P/>. Anyways nice API works well :D/>.
2217 posts
Location
3232235883
Posted 14 August 2013 - 10:40 AM
would suggest you not use this, i made a little cracker in normal lua that would crack the "hashes" in a matter of seconds
350 posts
Posted 19 May 2014 - 10:41 PM
a basic encryption program for you lazy people
I am not lazy :(/> i just dont have the knowledge to develop a thing like this (you can say that not searching is lazyness, but i do search, slowly learning but getting further)
Anyways as i said, i cant make an encryption API, but i needed one to make a server-client API and i really like your's. Is that ok if i copy your code and paste in my code? (i have a comment giving you credits)
PS: i read that you allow us to share by giving you credit, but i dont want to use it as an api, but implementing it in a single code. (if i am making myself clear)
Thanks
1114 posts
Location
UK
Posted 20 May 2014 - 05:18 PM
a basic encryption program for you lazy people
I am not lazy :(/> i just dont have the knowledge to develop a thing like this (you can say that not searching is lazyness, but i do search, slowly learning but getting further)
Anyways as i said, i cant make an encryption API, but i needed one to make a server-client API and i really like your's. Is that ok if i copy your code and paste in my code? (i have a comment giving you credits)
PS: i read that you allow us to share by giving you credit, but i dont want to use it as an api, but implementing it in a single code. (if i am making myself clear)
Thanks
Y U Necro… :D/>
1610 posts
Posted 20 May 2014 - 05:32 PM
A two year necro, is that a record? XD
1114 posts
Location
UK
Posted 20 May 2014 - 05:39 PM
A two year necro, is that a record? XD
The previous post was August 2013 :D/>
1610 posts
Posted 20 May 2014 - 08:08 PM
A two year necro, is that a record? XD
The previous post was August 2013 :D/>
Nvm, I dun derped… Read 2012…