Jump to content




Enigma - Encryption API For Your Programs v4

utility

15 replies to this topic

#1 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 25 September 2013 - 05:45 AM

Enigma - Encryption API For Your Programs v4.5

Enigma is a Simple to use encryption software made in order to ensure security of your programs on SMP servers. Multiple functions allow you to use it in the way you feel is best for you!

Encryption system is based of Military version of Enigma Machine.
I am trying to keep it as close to how original Enigma Machine worked as i can.
You can select 3 out of 10 predefined Rotors. You then select starting positions of said Rotors.
That gives 857375000 unique Rotor/Start Position combinations.
You can read more about it in http://en.wikipedia..../Enigma_machine
I have made few modification to it in order to be able to encrypt all common use symbols.

Download Here: http://pastebin.com/WYuNMxQx
Or ingame using command:
pastebin get WYuNMxQx enigma

Features List:
  • Encryption/Decryption of strings
  • 100% safe to your programs - no risk of corruption - if Enigma sees symbol it don't understands it simply writes it on without encryption.
Methods:
--# create a new crypter
crypter =  enigma.crypt(A,B,C,a,b,c)
--# A,B,C,a,b,c are starting positions on crypter.
--# where A,B,C are numbers 1-10 that tell enigma witch out of 10 standard rotors to use and a,b,c are numbers from 1-96 that set starting positions of said rotors.
--#A,B,C can also be a valid rotor tables.Valid rotor table is table containing numbers from 1-96 in random order.

--# encrypting string
ciphertext = crypter("plaintext")

--# duplicating crypter
crypterclone = crypter.copy()

--# to decrypt create crypter with same  starting positions as one used to encrypt
decrypter =  enigma.crypt(A,B,C,a,b,c)
decrypter(ciphertext) -> "plaintext"

--# to stop crypter from being able to be copied simply add true flag at end of attributes
nocopycrypter =  enigma.crypt(A,B,C,a,b,c,true)

--# You can also stop duplication at later time by running
nocopycrypter.blockCopy()


Here is example program:
Spoiler

Notes:
  • In case of A,B,C instead of using numbers 1-10 for standard rotors you can make your own and give it instead of the number. Rotor is table containing numbers from 1-96 in random order.
  • Instead of loading enigma as API you can use it as file encryption program. Simply use "enigma <absolute path> and after few quick questions selected fill will be encrypted.
  • Enigma was secure at time of its creation. In this days it is easy to brute force. This program was not made to be a secure encryptor instead it is a recreation of actual enigma method of encryption.
Archived older program version
Spoiler

Edited by wojbie, 01 December 2015 - 08:24 AM.


#2 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 25 September 2013 - 11:48 AM

interesting :)

i might make a cracker for it :3

#3 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 25 September 2013 - 12:31 PM

Feel free to do so. It would please me greatly. :P

If you peek in advanced usage in program help you will see that this exact video series inspired me to make it ;D
This version only has 857 375 possible different combinations.
With interchangeable Rotors (3 out of 10) [planed in v2] that would increase into 617 310 000 possible different combinations.
I am not sure if i will implement Plugboard.
I am thinking about implementing Reflector that removes flaw from this video. But that will wait until someone Codes Bomba. :D

EDIT : Hmm i need to test how easy its to brute-force it - probably real easy :(
But who cares its a Enigma!

EDIT 2 :I Could increase security by selecting 10 from 10 rotors- but then it would not be Enigma anymore... On other hand i already increased alphabeth from orginal to include Uppercase letters and symbols like !@#$$%^&*()_+{}||"?...

EDIT 3 : OK i am making v2 right away - i managed to brute-force all possible passes in 47.5 minutes. That was on
631 characters long file test file with last tested combination as password. Still kinda week.

EDIT 4 : Version 2 is ready and posted - now it will take about a 32,9 days to brute force trough all possible combinations. On side note i seem to really like editing my own post..... I think its my ego.

EDIT 5 : Note here that times i posted here are made using ingame brute-force code - taking encoded file outside of ComputerCraft would decrease decoding time significantly.

#4 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 25 September 2013 - 06:21 PM

View PostNekoloch, on 25 September 2013 - 06:19 PM, said:

Why would encryption for programs even be needed? All the programs made here are meant to be Open-Source only.
Passwords I would see encryption for, but this I wouldn't be able to find a use for it.
Good job on the GUIs though!
obufuscating code is not the only use for encryption.

#5 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 25 September 2013 - 06:24 PM

It was made for 3 reasons
  • Because i wanted to make Working version of Enigma
  • Because people keep stealing my tree-cutting turtle
  • Because when you keep something like password for wireless communication in program then with some encrypting and regularly changed passwords you can ensure that even if someone stole your data password still is secure.
  • Because why not? Its feels nice to make something :P


#6 amtra5

  • Members
  • 166 posts
  • LocationMelbourne, Australia

Posted 26 September 2013 - 06:02 PM

View PostNekoloch, on 25 September 2013 - 06:30 PM, said:

View Postwojbie, on 25 September 2013 - 06:24 PM, said:

It was made for 3 reasons
  • Because i wanted to make Working version of Enigma
  • Because people keep stealing my tree-cutting turtle
  • Because when you keep something like password for wireless communication in program then with some encrypting and regularly changed passwords you can ensure that even if someone stole your data password still is secure.
  • Because why not? Its feels nice to make something :P/>

Heh, seems a bit casual gotta love your reasons. I don't know anyone who would put their passwords into a plain-text file though haha!
You might make an invisibility cloak (you know, Harry Potter?) for your Turtle as well... someone needs to make that, so people stop stealing your turtles.


#7 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 01 March 2015 - 10:53 AM

Update and Direction Change!

This program got changed into an API for you to use in your programs as needed!
Older version moved to archive spoiler at bottom of post.
New version is faster and uses metatables!
Hope it fits your needs.

PS. Could i request Admin to move this into Utilites and API's subforum? As it is no longer a simple program.

#8 direTry20

  • Members
  • 5 posts

Posted 31 October 2015 - 04:09 AM

why do u need to clone the crypter, why bother to, it doesn't seem that u need to. idk

Edited by direTry20, 31 October 2015 - 04:11 AM.


#9 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 31 October 2015 - 08:21 AM

View PostdireTry20, on 31 October 2015 - 04:09 AM, said:

why do u need to clone the crypter, why bother to, it doesn't seem that u need to. idk

Because crypter has a state it's set to. When you encrypt something that state changes. And to decrypt you need crypter in same state as it was when encrypting the message. The copy function is there simply for convenience sake. You can create same crypter using same numbers. It's just simpler to copy one.

Edited by wojbie, 31 October 2015 - 08:22 AM.


#10 jaredallard

  • Members
  • 124 posts
  • LocationSeattle, WA

Posted 07 November 2015 - 01:02 AM

Can we have a mathematical proof of this right now? It doesn't appear to exactly follow the original machine. Also, I'd like to see it not not churn out the same letter as the original, as that was a big issue for the original machine. That would make it less crackable! Also, what about the front board sockets? Those increased the complexity and were only issued in the military versions.

#11 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 01 December 2015 - 08:19 AM

Update - version 4.5
  • Added sanity test to ensure most common bugs are stopped.
  • Added ability to disable making copies of cypher. It can be defined when creating a cypher or at later time by running block function inside it.
  • Moved the cypher state inside the secure local table. This stops outside functions for touching the state and allows the copy blocking to be secure. Also its more secure than in last version so yea.
And now for the response to really old post. Sorry its late but for some reason i did not get notification about the post.

View PostRainbowDashDC, on 07 November 2015 - 01:02 AM, said:

Can we have a mathematical proof of this right now? It doesn't appear to exactly follow the original machine. Also, I'd like to see it not not churn out the same letter as the original, as that was a big issue for the original machine. That would make it less crackable! Also, what about the front board sockets? Those increased the complexity and were only issued in the military versions.

It is based on one of first enigma designs. That means one turnover notch per a rotor and 3 rotors at same time.
I will do a logical proof. Input letter -> 1st rotor -> 2nd rotor -> 3th rotor -> reflector -> backwards 3th rotor -> backwards 2nd rotor -> backwards 1st rotor -> output letter. Then step 1st rotor and repeat with next letter. This is how enigma worked and how this program works.

The difference from original machine in in the rotors itself. This program don't incorporate the turnover notch between letters position (Its between last and first letter). Also the rotors itself are custom made for the program. Because lua uses more symbols than original enigma i had to extend the rotors to contain all those letters and symbols. That means rotors are extended from original 26 letters into 96 possible letters.

As for not churning the same letter as original? That is error inside the enigma logic itself. It can not be removed without changing the way enigma works.
Switchboard was planned but i threw it out after i coded in ability for people to provide their own rotor tables. It gives same complexity extension in the end.

Edited by wojbie, 01 December 2015 - 12:48 PM.


#12 LDDestroier

  • Members
  • 1,091 posts
  • LocationACDC Town

Posted 01 December 2015 - 11:50 AM

Cool, now you are an official member of the German Nationalist-Socialist party! Sieg heil!

#13 LDDestroier

  • Members
  • 1,091 posts
  • LocationACDC Town

Posted 01 December 2015 - 01:55 PM

I'm going to make an encrypted decentralized chat out of this. Can you suggest a funny name for it? I'm not too good with program names.

#14 Lupus590

  • Members
  • 1,967 posts
  • LocationUK

Posted 01 December 2015 - 03:14 PM

View PostLDDestroier, on 01 December 2015 - 01:55 PM, said:

I'm going to make an encrypted decentralized chat out of this. Can you suggest a funny name for it? I'm not too good with program names.

Hush? Whisper? EDC?

#15 LDDestroier

  • Members
  • 1,091 posts
  • LocationACDC Town

Posted 01 December 2015 - 03:44 PM

Pretty good names. All I gotta do now is learn how to use it, wah!

#16 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 07 December 2015 - 01:33 PM

Update - version 4.6
  • Fixed logic error in encryption algorithm that in edge case caused encrypted code to be corrupted.
WARNING: THIS UPDATE CHANGES THE ENCRYPTION ALGORITHM. IT IS INCOMPATIBLE WITH FILES ENCRYPTED WITH OLDER VERSION.

Edited by wojbie, 07 December 2015 - 01:33 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users