Author Topic: Cryptography Discussion/Programming  (Read 4519 times)

0 Members and 1 Guest are viewing this topic.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Cryptography Discussion/Programming
« on: April 02, 2011, 03:39:08 am »
I have been thinking of starting a thread like this for a while. Basically the purpose of this thread at least how it was in my head was that we would make/program/and maybe break some interesting encryption programs. I don't know very much about key encryption, but I have written a few just alphanumeric replacement algorithms. I ahve multiple ideas of how to create a good, fun discussion on this topic.

One way I thought of doing this was making a kind of competition(run by someone with a lot more experience than me) that pits two teams against each other. What we'd do is have two teams each would create their own kind of encryption program with certain criteria(not sure what these should be). when they finished each would try to break the others code in a certain amount of time. The winner would be whatever team has not had their code broken and has follow the criteria best(As decided by the person running the competition). Another version on this I had seemed to be less fun. It would be where we still had two teams just one team is encryption and one is cracking. The criteria for winning would be to successfully break or keep your code from being broken.

My second idea is that we are all one team working on one kind of project(making or breaking) a code. This would probably be the one where we can do the most interesting projects and for some people this would would definitely be more fun for some people. thsi would be more of one we decide what we do(criteria) by the project

My last idea is basically the two above combined. We just decide which one we want to do more by what the community wants to do the most. this would probably be the oveall best choice because it almost guaruntee that the majority of people will get their choice on what we want to do.

I'll post a copy of my code for the encryption of text strings i wrote later.(It is a form of binary encryption and written in python)
« Last Edit: April 02, 2011, 03:39:26 am by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Cryptography Discussion/Programming
« Reply #1 on: April 02, 2011, 09:35:49 am »
I have a few encryption systems laying around that I'm fairly sure no one is going to be able to break, so I'd leave to test it out ;D
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Cryptography Discussion/Programming
« Reply #2 on: April 02, 2011, 12:33:52 pm »
Okay, sample criteria:
  • Each team has to accurately document their encryption code and decryption code.
  • Each encryption should be able to take data of any length. (e.g. if it works in blocks of 512 bytes, or works with 4 bytes at a time, it needs to compensate for input that doesn't fit that criteria)
  • There is a standard 10 different data sets that they give both the plaintext and cipher text.  For example, "the game" could be a phrase that they turn into the hex encrypted bytes.
  • Any password key used during the encryption of the test cases should be stated with the algorithm, and should remain constant for the 10 test cases.
  • An algorithm is considered broken if you can either:
  • Decrypt the data without the pass code.
  • Figure out the pass code by knowing something about the original plaintext.
  • Figure out how to encrypt data to form a collision.  This is an important one, and only applies to select algorithms in total.  I'll explain more below.
Explanation of collisions:
Say I have two plain texts (before encryption), P1 and P2.  I also have two keys, K1 and K2.  There is also the cipher texts (after encryption) C1 and C2.  If I take P1, encrypt it with K1, and get C1, then that is the encryption algorithm.  Encrypting P2 with K2, and getting C2 works with the algorithm as well.  The problem is if C1 == C2.  That is called a collision.  It's even worse of K1 == K2 or P1 == P2.  So essentially, if you take the encrypted text, and find another Key/Plaintext pair that gives the same encrypted text, then the algorithm is considered cracked as well.

I'll think up some good test cases that range from strings to large files.  Also, if you want to make a program, I would suggest making it in java, and having it accept files as input, and files as output.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Cryptography Discussion/Programming
« Reply #3 on: April 10, 2011, 10:05:28 pm »
I would like to use graphmasturs idea. Does anyone else want to?

I have a good cipher I made just it only works if its operation is kept secret
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Cryptography Discussion/Programming
« Reply #4 on: April 10, 2011, 10:11:43 pm »
I would like to use graphmasturs idea. Does anyone else want to?

I have a good cipher I made just it only works if its operation is kept secret
do you mean you couldn't tell how the algorithm worked? If not, then I don't like that.  I think you need to tell how they work, as secrecy isn't usually better than cryptography.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Cryptography Discussion/Programming
« Reply #5 on: April 10, 2011, 10:12:56 pm »
Hehe, I am about to upload a cryptography program to TICalc that I have added to TIBD. You can even look at the source and it won't help you decrypt encrypted text XD If I use a little asssembly I can make it encrypt any data (not just text and numbers).

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Cryptography Discussion/Programming
« Reply #6 on: April 10, 2011, 10:15:48 pm »
I couldn't tell anyone how it worked. It is not a key cipher. It has a set operation that happens every time.
I know that is weaker but I'm not good at making other kinds. This might only take a while to break but It is an interesting cipher(at least to me I might be slightly biased)
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Cryptography Discussion/Programming
« Reply #7 on: April 10, 2011, 10:16:35 pm »
Well, I have an very nice encryption engine in an old BASIC game that uses something akin to SMC to encrypt it >:D

I also have another [better] algorithm that's never been put in BASIC, though.
* Qwerty.55 downloads Xeda's program
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Cryptography Discussion/Programming
« Reply #8 on: April 10, 2011, 10:18:30 pm »
Hehe, the source is here: http://tibasicdev.wikidot.com/cryptography#toc4
All you need to do is where you define Str2, you make Str2 all the chars it can make use of :) From there, your key is a seed :) I think the code I typed in was correct...

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Cryptography Discussion/Programming
« Reply #9 on: April 10, 2011, 10:32:10 pm »
How do you make key encryptions work?
I would like to learn some so I can come up with better forms of encryption
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Cryptography Discussion/Programming
« Reply #10 on: April 10, 2011, 10:35:21 pm »
How do you make key encryptions work?
I would like to learn some so I can come up with better forms of encryption
That totally depends on how your formula works.  For example, things like RSA have public/private keys and release the public keys.  One site i like to look at for certain things is this

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Cryptography Discussion/Programming
« Reply #11 on: April 10, 2011, 11:13:34 pm »
Okay, so I was using the rand seed method and I noticed that if I encrypt it twice with two different keys, I have to decrypt in the reverse order (not just any order). So if I encrypt first with the key 22 then I encrypt it again with 997, I need to decrypt first with 997, then I decrypt the result with 22. Is that true with most replacement encryptions? Sorry, just curious...

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Cryptography Discussion/Programming
« Reply #12 on: April 11, 2011, 07:19:12 am »
Okay, so I was using the rand seed method and I noticed that if I encrypt it twice with two different keys, I have to decrypt in the reverse order (not just any order). So if I encrypt first with the key 22 then I encrypt it again with 997, I need to decrypt first with 997, then I decrypt the result with 22. Is that true with most replacement encryptions? Sorry, just curious...
For most of them, yes.  In fact, that's better that way to only go in that one order.