#1
Posted 21 June 2012 - 11:02 PM
#2
Posted 21 June 2012 - 11:06 PM
And why do you want to split the words? you should encrypt the whole string.
#3
Posted 21 June 2012 - 11:19 PM
#4
Posted 21 June 2012 - 11:27 PM
tfoote, on 21 June 2012 - 11:19 PM, said:
Well, first things first, what do you need to encrypt? passwords? network messages? files?
For passwords you should use some hashing algorithm, like md5 or sha.
For network messages, use asymetric key encryption.
And for files and other things, you probably want to use symetric key encryption.
There's a lot of hashing/encryption algorithms, you need to use the one that fits your needs (or create your own).
#5
Posted 21 June 2012 - 11:29 PM
#6
Posted 21 June 2012 - 11:46 PM
Encryption is very very very hard to do right. If you want to come up with some random not-very-secure encryption of your own, use string.bytes and string.char to get it in and out of a more easy to use format.
#7
Posted 21 June 2012 - 11:49 PM
#8
Posted 22 June 2012 - 12:15 AM
I suppose that asymetric key encryption would be the best for network things, but I don't think it's necesary, since with modems you can send messages between two computers and noone else can see it.
If you still want to add encryption, do some research on the existing algorithms and how they work.
#9
Posted 22 June 2012 - 04:00 AM
term.clear()
term.setCursorPos(1, 1)
local iEncrypt = nil
local sMessage = nil
local tWords = {}
function NULLencrypt(tWords) --tried to encrypt as a whole before I realized I could do it during table.insert
for i = 1, #tWords do --function NULLencrypt is not necessary in program code as it is not used
local sTemp = nil
for i = 1, string.len(tWords[i]) do
if i == 1 then
sTemp = tWords[i]:byte(i)
else
sTemp = sTemp .. " " .. tWords[i]:byte(i)
end
tWords[i] = sTemp
end
end
return true
end
function encrypt(string)
local sTemp = nil
for i = 1, string.len(string) do
if i == 1 then
sTemp = string:byte(i)
else
sTemp = sTemp .. " " .. string:byte(i)
end
end
return sTemp
end
term.write("Enter message: ")
sMessage = tostring(io.read())
for match in string.gmatch(sMessage, "[^ t]+") do
table.insert( tWords, encrypt(match) .. "b" )
end
for i = 1, #tWords do
print(tWords[i])
end
The way I would encrypt this would be to add another function that breaks down each "line" of output and multiplies each char code by a user-defined number. This number would then be sent at the very beginning of any rednet message so that the receiving computer can decode the message. Any computers spying will only get a string of huge numbers that won't mean anything. I probably will add this and a decoder to bosschat since I've done the legwork already.
To further screw with spy's, reverse each word before encryption, then reverse the entire table. Then laugh as they flip their tables trying to code a way around your encryption.
(╯°□°)╯︵ ┻━┻
Sample output:
#10
Posted 22 June 2012 - 04:32 AM
Bossman201, on 22 June 2012 - 04:00 AM, said:
term.clear()
term.setCursorPos(1, 1)
local iEncrypt = nil
local sMessage = nil
local tWords = {}
function NULLencrypt(tWords) --tried to encrypt as a whole before I realized I could do it during table.insert
for i = 1, #tWords do --function NULLencrypt is not necessary in program code as it is not used
local sTemp = nil
for i = 1, string.len(tWords[i]) do
if i == 1 then
sTemp = tWords[i]:byte(i)
else
sTemp = sTemp .. " " .. tWords[i]:byte(i)
end
tWords[i] = sTemp
end
end
return true
end
function encrypt(string)
local sTemp = nil
for i = 1, string.len(string) do
if i == 1 then
sTemp = string:byte(i)
else
sTemp = sTemp .. " " .. string:byte(i)
end
end
return sTemp
end
term.write("Enter message: ")
sMessage = tostring(io.read())
for match in string.gmatch(sMessage, "[^ t]+") do
table.insert( tWords, encrypt(match) .. "b" )
end
for i = 1, #tWords do
print(tWords[i])
end
The way I would encrypt this would be to add another function that breaks down each "line" of output and multiplies each char code by a user-defined number. This number would then be sent at the very beginning of any rednet message so that the receiving computer can decode the message. Any computers spying will only get a string of huge numbers that won't mean anything. I probably will add this and a decoder to bosschat since I've done the legwork already.
To further screw with spy's, reverse each word before encryption, then reverse the entire table. Then laugh as they flip their tables trying to code a way around your encryption.
(╯°□°)╯︵ ┻━┻
Sample output:
That is not encryption nowhere near it.
Not even remotely secure.
#11
Posted 22 June 2012 - 08:20 AM
local tWords = {}
for match in string.gmatch(sMessage, "[^ t]+") do
table.insert( tWords, match .. "b" )
end
Technically, it is still encryption because...I can't read it, can you?Quote
#12
Posted 22 June 2012 - 08:33 AM
Bossman201, on 22 June 2012 - 08:20 AM, said:
local tWords = {}
for match in string.gmatch(sMessage, "[^ t]+") do
table.insert( tWords, match .. "b" )
end
Technically, it is still encryption because...I can't read it, can you?Quote
Your not using an algorithm are you?
And the special knowledge/key would be if you knew the key you need to decrypt it like in symmetrical / asymmetrical encryption or the decryption algorithm.
//EDIT: This is the encryption api from my string utils api, I'm not saying it is extremely secure but it does require you to know the key for encryption/decryption i.e. symmetrical, EncryptionUtils.lua
#13
Posted 22 June 2012 - 01:35 PM
#14
Posted 22 June 2012 - 02:27 PM
tomass1996, on 22 June 2012 - 08:33 AM, said:
Bossman201, on 22 June 2012 - 08:20 AM, said:
local tWords = {}
for match in string.gmatch(sMessage, "[^ t]+") do
table.insert( tWords, match .. "b" )
end
Technically, it is still encryption because...I can't read it, can you?Quote
Your not using an algorithm are you?
And the special knowledge/key would be if you knew the key you need to decrypt it like in symmetrical / asymmetrical encryption or the decryption algorithm.
//EDIT: This is the encryption api from my string utils api, I'm not saying it is extremely secure but it does require you to know the key for encryption/decryption i.e. symmetrical, EncryptionUtils.lua
You don't understand what the word algorithm means. He's using an algorithm. However, that's an obfuscation technique, not an encryption technique. Security through obscurity is no security at all.
#15
Posted 22 June 2012 - 03:06 PM
Lyqyd, on 22 June 2012 - 02:27 PM, said:
Again, until we get a bootloader lock, security through obscurity is the only possibility for any computer that someone can access and place a disk drive next to. You can, theoretically, use asynchronous cryptographic message signing to send messages between properly secured computers across an unsecured network, I guess.
I was trying to figure out how to create a dynamic trusted network amongst work turtles. Unfortunately, the best I can come up with is one where they store encryption keys in memory only, and their startup script just has them path back to a secured base and get reset. (I am still hoping the bios will get updated before I implement my secured networking system, so I haven't implemented it yet.)
#16
Posted 22 June 2012 - 03:42 PM
kazagistar, on 22 June 2012 - 03:06 PM, said:
#17
Posted 22 June 2012 - 04:06 PM
MysticT, on 22 June 2012 - 03:42 PM, said:
What does "you" mean? Both sender and receiver computers must know some kind of cipher, and if one of them is compromised, then the hacker has access to both your algorithm and your cipher, and your messages are no longer fully trusted.
Of course, if you only store your password in memory, then you are fine, but that means you have to type in the password manually on every single computer you want to be able to communicate, and verify that it is not compromised first.
#18
Posted 22 June 2012 - 05:29 PM
If you want to make some network system, with routers and everything, then it could be usefull. Without that is just adding unnecesary overhead.
Also, why would having a bootloader lock be helpfull with this? It would only hide your code, wich is pretty much security through obscurity.
#19
Posted 22 June 2012 - 06:38 PM
MysticT, on 22 June 2012 - 05:29 PM, said:
If you want to make some network system, with routers and everything, then it could be usefull. Without that is just adding unnecesary overhead.
Also, why would having a bootloader lock be helpfull with this? It would only hide your code, wich is pretty much security through obscurity.
Yes, if you just use a password and encryption for storing and retrieving local files, you can be safe. But what is the point?
#20
Posted 22 June 2012 - 07:08 PM
Everything else has basically been saying NOTHING, ANYWHERE IS SAFE!!! We get it. A man with a crowbar can't easily get through an iron door, but a man with TNT can. Everything that has an access point has a weakness. Shut up, get over it, manage your computers responsibly. Never store something you would not want to lose on them. If you want to keep something safe, use a floppy that you keep in your inventory. Or, if you have EE, put it in a bag. If the bag is destroyed, just make a new one. It will bring back YOUR inventory.
And, the point is always "BECAUSE WE CAN".
Can we please move on?
Sorry for the Capslocks. I needed to vent. And get you to pay attention to that specific text.
TFoote, use Bossman201's code. As has been said, Obfuscation is best until such time as we can just mod bios.lua. Which is unlikely to happen. But be aware that anytime you just rearrange the text, someone, somehow, will figure out how to put it back right.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











