| View previous topic :: View next topic |
| Author |
Message |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Sat Sep 03, 2011 12:16 pm Post subject: Thoughts on this Cipher? |
|
|
It's my own type of Vernam cipher. Those work by having a key string and input string. Each character of the input string is shifted by the value of the corresponding character of the key string. The only way to crack the code is to try every possible message.
These are not easy to use because if you have a message 1000 characters long, you and your recipient would need to have a 1000 character key. I decided to make my own way to do this.
Basically, you make a small key, say "TROLL" and pick a shift amount, say 3. Each "level" of the final key will take each character of the smallKey(SK from now on) Shift it by the shift amount, then add the character after next. So with out key and shift, the first level is:
WOULRLOTOR
Without a shift(or shift of 0) we have: TORLOLLTLR
This becomes the new SK for the next level, giving us.
ZURLXROLUOOTROWRRWUO
Without a shift(or shift of 0) we have:TROLROLLOLLTLLTRLTRO
Etc. etc.
The program automatically calculates the level needed to fully encrypt the input string, and the shift ensures the final key won't get into some nasty repeating patterns where entire words may be encrypted with the same character.
So thoughts on this system? All the power of a vernam cipher using simple keys.
Note: All shifts and character additions are done by casting the char to an int, applying the shift, then casting back to char. That means any symbol can be encrypted.
EXAMPLE:
"CEF is full of fucktards and pricks, but I love 'em all. <3" becomes
"ls}ׁٷ}s"
with a SK of "TROLL" and shift of 7
|
|
| Back to top |
|
 |
Cheat Engine User Something epic
Reputation: 61
Joined: 22 Jun 2007 Posts: 2071
|
Posted: Sat Sep 03, 2011 12:27 pm Post subject: |
|
|
How DO you apply the shift? As far as I know doing that sounds pretty strange unless you're going out of boundaries (above 255) which are changes that will be lost in the process.
Edit: Ah, like that, well, chars are numbers too in essence, no need to cast it to an int.
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Sat Sep 03, 2011 12:29 pm Post subject: |
|
|
| Holland wrote: | How DO you apply the shift? As far as I know doing that sounds pretty strange unless you're going out of boundaries (above 255) which are changes that will be lost in the process.
Edit: Ah, like that, well, chars are numbers too in essence, no need to cast it to an int. |
Thanks for that tip
As long as you have a unicode font, you can read the output but that's not important. I use characters just as placeholders for the numbers they correspond to. That way I can get a string of equal length instead of a massive comma delimited number list.
Being able to see symbols is just a happy side effect.
|
|
| Back to top |
|
 |
Kargarok Advanced Cheater
Reputation: 10
Joined: 28 Jul 2011 Posts: 60
|
Posted: Sat Sep 03, 2011 12:32 pm Post subject: |
|
|
| I'm fucking confused.
|
|
| Back to top |
|
 |
Cheat Engine User Something epic
Reputation: 61
Joined: 22 Jun 2007 Posts: 2071
|
Posted: Sat Sep 03, 2011 12:33 pm Post subject: |
|
|
| Kazekeil wrote: | | Holland wrote: | How DO you apply the shift? As far as I know doing that sounds pretty strange unless you're going out of boundaries (above 255) which are changes that will be lost in the process.
Edit: Ah, like that, well, chars are numbers too in essence, no need to cast it to an int. |
Thanks for that tip :D
As long as you have a unicode font, you can read the output but that's not important. I use characters just as placeholders for the numbers they correspond to. That way I can get a string of equal length instead of a massive comma delimited number list.
Being able to see symbols is just a happy side effect. | No what I meant is that chars are numbers, a byte (in 32 bit at least) to be exact. That said, you can simply do anything you'd usually do with an integer or double or float for example with a char, like this:
char t_Char = 0;
t_Char += 7;
// t_Char is now 7
Just saying. If you output them on screen, they will output the corresponding character that belongs with the number 7.
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Sat Sep 03, 2011 12:35 pm Post subject: |
|
|
| LemonadeStand wrote: | | I'm fucking confused. |
I took quite possibly the most secure and cumbersome string cipher and made it simple to use, leaving me with the most secure string cipher.
I made sure to put string cipher, because I'm pretty sure there are other ciphers for other things out there much better than my hacked together little system.
| Holland wrote: | | Kazekeil wrote: | | Holland wrote: | How DO you apply the shift? As far as I know doing that sounds pretty strange unless you're going out of boundaries (above 255) which are changes that will be lost in the process.
Edit: Ah, like that, well, chars are numbers too in essence, no need to cast it to an int. |
Thanks for that tip
As long as you have a unicode font, you can read the output but that's not important. I use characters just as placeholders for the numbers they correspond to. That way I can get a string of equal length instead of a massive comma delimited number list.
Being able to see symbols is just a happy side effect. | No what I meant is that chars are numbers, a byte (in 32 bit at least) to be exact. That said, you can simply do anything you'd usually do with an integer or double or float for example with a char, like this:
char t_Char = 0;
t_Char += 7;
// t_Char is now 7
Just saying. If you output them on screen, they will output the corresponding character that belongs with the number 7. |
No I got that, that's why i put "Thanks for the tip"
The other little bit I put was just some thoughts I didn't add to the main post.
Last edited by Evil_Intentions on Sat Sep 03, 2011 12:36 pm; edited 1 time in total |
|
| Back to top |
|
 |
Kargarok Advanced Cheater
Reputation: 10
Joined: 28 Jul 2011 Posts: 60
|
Posted: Sat Sep 03, 2011 12:36 pm Post subject: |
|
|
| 3: You guys make me feel stupid
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Sat Sep 03, 2011 12:43 pm Post subject: |
|
|
While you're here holland, what are your thoughts on it?
I mean, I realize it'll never really be used anywhere, but as a shits and gigs project how is it?
Anything else I could add during the encryption process? Possibly another shift at a certain point or character to further vary final strings?
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sat Sep 03, 2011 12:46 pm Post subject: |
|
|
| 'Tis all zero's and one's
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Sat Sep 03, 2011 1:10 pm Post subject: |
|
|
If anyone wants to see the source so far. Need to add in the matrix encryption, then I'll start working on the decryption class and add documentation.
http://pastebin.com/MsTZD2PT
to use, just do something like this:
Encrypt enc = new Encrypt();
System.out.println(enc.Vernam("Hello World", "TRULUL", 4));
System.out.println(enc.Caeser("Hello World", 3));
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sat Sep 03, 2011 1:16 pm Post subject: |
|
|
NO SPACES IN SOURCE CODE
>java
u cerial?
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Sat Sep 03, 2011 1:22 pm Post subject: |
|
|
| Noz3001 wrote: | NO SPACES IN SOURCE CODE
>java
u cerial? |
Don't know what you mean by this...I'm still pretty new at java.
Can't tell if hatin or motivatin
|
|
| Back to top |
|
 |
Killor1 Master Cheater
Reputation: 5
Joined: 21 May 2008 Posts: 499 Location: Memphis
|
Posted: Sat Sep 03, 2011 1:24 pm Post subject: |
|
|
| Kazekeil wrote: | | Noz3001 wrote: | NO SPACES IN SOURCE CODE
>java
u cerial? |
Don't know what you mean by this...I'm still pretty new at java.
Can't tell if hatin or motivatin |
it's pretty both, but he's trying to motivate you to use something worthy. if i am correct.
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Sat Sep 03, 2011 3:56 pm Post subject: |
|
|
mfw noone comments on the cipher itself
;-;
;~;
;^;
|
|
| Back to top |
|
 |
Kargarok Advanced Cheater
Reputation: 10
Joined: 28 Jul 2011 Posts: 60
|
Posted: Sat Sep 03, 2011 4:00 pm Post subject: |
|
|
| I don't know anything at all about this, but it looks complicated and cool ^.^ Was it hard to make?
|
|
| Back to top |
|
 |
|