 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Tue Sep 27, 2011 2:57 pm Post subject: Question for Aviar, Augustine, or Slug(if you're here) |
|
|
What is more secure in a cipher? A per character shift or xor?
I have a key text as long as my plaintext. In the shift method, each character from the key text is added to the matching character of the plaintext. In the xor method, each is just xor'd. So if my key was "ab" and my plaintext "hi"
Think of characters as placeholders for numbers, not as characters. My program uses unicode btw.
SHIFT:
(a=97) + (h=104) = (É=201)
(b=98) + (i=105) = (Ë=203)
XOR:
(a=97) xor (h=104) = ( =9)<-horizontal tab
(b=98) xor (i=105) = (=11) <- vertical tab
This method will be used on much larger sentences. To me they seem about the same. Your thoughts? I can scan my notes for the rest of the cipher if you want to see
The shift method is good for a character output, but that doesn't always work(like with this forum), the xor method produces much smaller numbers so a comma delimited string of numbers could be used, which would work in any situation.
|
|
| Back to top |
|
 |
Aniblaze Grandmaster Cheater Supreme
Reputation: 138
Joined: 23 Apr 2006 Posts: 1757 Location: The Netherlands
|
Posted: Tue Sep 27, 2011 3:05 pm Post subject: |
|
|
| Any cipher at risk of data loss depending on the input, is per definition an unwise choice. If that's not the case, I would go with the one that uses the least resources to perform the task. That said, this cipher seems somewhat at risk of being cracked quite easily, with all the static values 'n all.
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Tue Sep 27, 2011 3:11 pm Post subject: |
|
|
| Augustine wrote: | | Any cipher at risk of data loss depending on the input, is per definition an unwise choice. If that's not the case, I would go with the one that uses the least resources to perform the task. That said, this cipher seems somewhat at risk of being cracked quite easily, with all the static values 'n all. |
I can post the code and explain it if you need in another post. Not insulting your intelligence, just I didn't comment it.
| Code: | public String CipherXor(String input, String key, int shift){
int level = Math.round((input.length()/key.length())/2)+1;
String enc = makeFullKey(key, level, shift);
String output = "";
for(int i = 0; i < input.length(); i++){
output+=(input.charAt(i)^ enc.charAt(i));
output+=",";
}
return output;
}
private String makeFullKey(String key, int level, int shift){
String startKey = key;
String nextKey = "";
String finalKey = "";
for(int i = 0; i<level; i++){
for(int j = 0; j<startKey.length();j++){
nextKey+=Character.toString((char)((int)startKey.charAt(j)+shift));
if(j==startKey.length()-2)
nextKey+=Character.toString(startKey.charAt(0));
else if(j==startKey.length()-1)
nextKey+=Character.toString(startKey.charAt(1));
else
nextKey+=Character.toString(startKey.charAt(j+2));
}
startKey = reverse(nextKey);//reverse just reverses the string, no need to copy it here
nextKey = "";
}
finalKey = startKey;
return finalKey;
}
|
The final key is made using a smaller key, typically 3-10 characters in length. There is a shift thrown in in the creation of key, as well as a reversal of the string at each level to promote a larger difference from the final key and the small key.
This entire cipher idea was simply a way to make a vernam cipher(one time pad) using a small key that can be shared easily.
|
|
| Back to top |
|
 |
Aviar³ Grandmaster Cheater
Reputation: 50
Joined: 03 Jan 2008 Posts: 655 Location: Canada
|
Posted: Tue Sep 27, 2011 3:17 pm Post subject: |
|
|
I havent done much study into cryptography, but I suppose theoretically, x0r could be better, since you cant unxor the data without the proper key. Of course, like any public key security scheme, the problem lies in actually keeping the key a secret. Also, xor schemes are quicker I believe. Then again, this is just what I sort of intuit based on some random things Ive read, and Jurassic Park.
_________________
This is the inception of deception, checking the depth of your perception.
 |
|
| Back to top |
|
 |
Coldie ;] Guest
|
Posted: Tue Sep 27, 2011 3:19 pm Post subject: |
|
|
| x0r, there's a reason he named himself x0r.
|
|
| Back to top |
|
 |
Aniblaze Grandmaster Cheater Supreme
Reputation: 138
Joined: 23 Apr 2006 Posts: 1757 Location: The Netherlands
|
Posted: Tue Sep 27, 2011 3:20 pm Post subject: |
|
|
Seeing the code makes me believe that I don't understand what you're doing, nor do I have the will to try and understand it (not saying it's bad or anything, I'm just tired after a day of work).
| Aviar³ wrote: | | I havent done much study into cryptography, but I suppose theoretically, x0r could be better, since you cant unxor the data without the proper key. Of course, like any public key security scheme, the problem lies in actually keeping the key a secret. Also, xor schemes are quicker I believe. Then again, this is just what I sort of intuit based on some random things Ive read, and Jurassic Park. |
This seems to make sense up to the Jurassic Park bit.
EDIT:
This is what I did to encrypt my shit, because using stuff that already exists and works is far easier:
| Code: |
$this->master_key = 'MASTERCODEHERE';
$this->level_one_key = 'CODEHERE1';
$this->level_two_key = 'CODEHERE2';
$this->variant_key = date("Ymdhi");
$this->variant_keyS = ((date("s") < 30) ? 1 : 2);
$this->keyObject = "";
|
| Code: |
private function getAuthenticationKey($customer_key) {
if (!extension_loaded('mcrypt')) {
die("Extension for encryption is not available on this machine.");
} else {
$authenticator = new Zend_Filter_Encrypt(array('adapter' => 'Mcrypt', 'key' => $this->variant_key . $this->variant_keyS));
$authenticator->setVector($this->level_one_key);
$encryptLvlOne = $authenticator->filter($customer_key);
$authenticator->setVector($this->level_two_key);
$encryptLvlTwo = $authenticator->filter($customer_key);
$authenticator->setVector($this->master_key);
$finalKey = $encryptLvlOne . ($authenticator->filter($encryptLvlOne . $encryptLvlTwo)) . $encryptLvlTwo;
}
return $finalKey;
} |
| Code: | public function getAuthentication($customer_key) {
$authArray = array();
$oldVariableKey = "";
$oldVariableKeyS = "";
$newVariableKey = "";
$newVariableKeyS = "";
if ($this->variant_keyS == 2) {
$oldVariableKey = $this->variant_key;
$oldVariableKeyS = 1;
$newVariableKey = $this->variant_key + 1;
$newVariableKeyS = 1;
} else {
$oldVariableKey = $this->variant_key - 1;
$oldVariableKeyS = 2;
$newVariableKey = $this->variant_key;
$newVariableKeyS = 2;
}
$authArray['currentKey'] = $this->getAuthenticationKey($customer_key);
$this->variant_key = $oldVariableKey;
$this->variant_keyS = $oldVariableKeyS;
$authArray['oldKey'] = $this->getAuthenticationKey($customer_key);
$this->variant_key = $newVariableKey;
$this->variant_keyS = $newVariableKeyS;
$authArray['newKey'] = $this->getAuthenticationKey($customer_key);
$this->keyObject = serialize($authArray);
return $this->keyObject;
} |
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Tue Sep 27, 2011 3:31 pm Post subject: |
|
|
Just posting this in case.
Final Key Building:
Small key(SK) is entered, "TEST" in this case. Also a shift is entered, 3 in this case.
The final size of the final key(FK) is SKlength X 2^L
L is the level of the FK. The user entered value is level 0.
To build the FK, the nth character of the SK is shifted by the amount shift, then added to the FK. Then the character at n+2 is tacked on without a shift. This continues at each character until the last character.
(T+3)S(E+3)T(S+3)T(T+3)E
WSATVTWE
You can see that with the last 2 characters, n+2 is nonexistant, so the program "wraps" around the key.
Then this new key(NK) is WSATVTWE. This is reversed and set as the new SK so that the process may repeat. EWTVTASW
(E+3)T(W+3)V(T+3)T(V+3)A(T+3)S(A+3)W(S+3)E(W+3)W
ATZVWTYAWSDWVEZW
This entire process continues until a FK is produced with a length greater than or equal to the plaintext.
EDIT: @Augustine, this isn't for a client or serious personal use, it's more of just something to keep me from staring at the ceiling in my boring classes today. I was just curious if xor or shift would be better
|
|
| Back to top |
|
 |
Aniblaze Grandmaster Cheater Supreme
Reputation: 138
Joined: 23 Apr 2006 Posts: 1757 Location: The Netherlands
|
Posted: Tue Sep 27, 2011 3:35 pm Post subject: |
|
|
| Kazekeil wrote: | Just posting this in case.
Final Key Building:
Small key(SK) is entered, "TEST" in this case. Also a shift is entered, 3 in this case.
The final size of the final key(FK) is SKlength X 2^L
L is the level of the FK. The user entered value is level 0.
To build the FK, the nth character of the SK is shifted by the amount shift, then added to the FK. Then the character at n+2 is tacked on without a shift. This continues at each character until the last character.
(T+3)S(E+3)T(S+3)T(T+3)E
WSATVTWE
You can see that with the last 2 characters, n+2 is nonexistant, so the program "wraps" around the key.
Then this new key(NK) is WSATVTWE. This is reversed and set as the new SK so that the process may repeat. EWTVTASW
(E+3)T(W+3)V(T+3)T(V+3)A(T+3)S(A+3)W(S+3)E(W+3)W
ATZVWTYAWSDWVEZW
This entire process continues until a FK is produced with a length greater than or equal to the plaintext.
EDIT: @Augustine, this isn't for a client or serious personal use, it's more of just something to keep me from staring at the ceiling in my boring classes today. I was just curious if xor or shift would be better |
I get what you're doing now that you've explained it. I'd go with x0r after what Aviar said.
|
|
| Back to top |
|
 |
br0l0ck Cheater
Reputation: 63
Joined: 15 Aug 2007 Posts: 38
|
Posted: Tue Sep 27, 2011 3:40 pm Post subject: |
|
|
| Coldie ;] wrote: | | x0r, there's a reason he named himself x0r. | i just found this out. i feel left out
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Tue Sep 27, 2011 8:02 pm Post subject: |
|
|
| Augustine wrote: | | Kazekeil wrote: | Just posting this in case.
Final Key Building:
Small key(SK) is entered, "TEST" in this case. Also a shift is entered, 3 in this case.
The final size of the final key(FK) is SKlength X 2^L
L is the level of the FK. The user entered value is level 0.
To build the FK, the nth character of the SK is shifted by the amount shift, then added to the FK. Then the character at n+2 is tacked on without a shift. This continues at each character until the last character.
(T+3)S(E+3)T(S+3)T(T+3)E
WSATVTWE
You can see that with the last 2 characters, n+2 is nonexistant, so the program "wraps" around the key.
Then this new key(NK) is WSATVTWE. This is reversed and set as the new SK so that the process may repeat. EWTVTASW
(E+3)T(W+3)V(T+3)T(V+3)A(T+3)S(A+3)W(S+3)E(W+3)W
ATZVWTYAWSDWVEZW
This entire process continues until a FK is produced with a length greater than or equal to the plaintext.
EDIT: @Augustine, this isn't for a client or serious personal use, it's more of just something to keep me from staring at the ceiling in my boring classes today. I was just curious if xor or shift would be better |
I get what you're doing now that you've explained it. I'd go with x0r after what Aviar said. |
What would you rate the ease of breaking it? Just a rough guesstimate out of 10? I'm thinking 4 ish.
Also how exactly WOULD you crack it? Finding the difference between two messages? or xoring two messages of similar length(the length will change the final key) to get the key..
|
|
| Back to top |
|
 |
Anarchy Expert Cheater
Reputation: 29
Joined: 15 Feb 2009 Posts: 104 Location: There.
|
Posted: Tue Sep 27, 2011 8:20 pm Post subject: |
|
|
| Kazekeil wrote: | | Augustine wrote: | | Kazekeil wrote: | Just posting this in case.
Final Key Building:
Small key(SK) is entered, "TEST" in this case. Also a shift is entered, 3 in this case.
The final size of the final key(FK) is SKlength X 2^L
L is the level of the FK. The user entered value is level 0.
To build the FK, the nth character of the SK is shifted by the amount shift, then added to the FK. Then the character at n+2 is tacked on without a shift. This continues at each character until the last character.
(T+3)S(E+3)T(S+3)T(T+3)E
WSATVTWE
You can see that with the last 2 characters, n+2 is nonexistant, so the program "wraps" around the key.
Then this new key(NK) is WSATVTWE. This is reversed and set as the new SK so that the process may repeat. EWTVTASW
(E+3)T(W+3)V(T+3)T(V+3)A(T+3)S(A+3)W(S+3)E(W+3)W
ATZVWTYAWSDWVEZW
This entire process continues until a FK is produced with a length greater than or equal to the plaintext.
EDIT: @Augustine, this isn't for a client or serious personal use, it's more of just something to keep me from staring at the ceiling in my boring classes today. I was just curious if xor or shift would be better |
I get what you're doing now that you've explained it. I'd go with x0r after what Aviar said. |
What would you rate the ease of breaking it? Just a rough guesstimate out of 10? I'm thinking 4 ish.
Also how exactly WOULD you crack it? Finding the difference between two messages? or xoring two messages of similar length(the length will change the final key) to get the key.. | out of 10
10 being what
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Tue Sep 27, 2011 8:21 pm Post subject: |
|
|
| Anarchy wrote: | | Kazekeil wrote: | | Augustine wrote: | | Kazekeil wrote: | Just posting this in case.
Final Key Building:
Small key(SK) is entered, "TEST" in this case. Also a shift is entered, 3 in this case.
The final size of the final key(FK) is SKlength X 2^L
L is the level of the FK. The user entered value is level 0.
To build the FK, the nth character of the SK is shifted by the amount shift, then added to the FK. Then the character at n+2 is tacked on without a shift. This continues at each character until the last character.
(T+3)S(E+3)T(S+3)T(T+3)E
WSATVTWE
You can see that with the last 2 characters, n+2 is nonexistant, so the program "wraps" around the key.
Then this new key(NK) is WSATVTWE. This is reversed and set as the new SK so that the process may repeat. EWTVTASW
(E+3)T(W+3)V(T+3)T(V+3)A(T+3)S(A+3)W(S+3)E(W+3)W
ATZVWTYAWSDWVEZW
This entire process continues until a FK is produced with a length greater than or equal to the plaintext.
EDIT: @Augustine, this isn't for a client or serious personal use, it's more of just something to keep me from staring at the ceiling in my boring classes today. I was just curious if xor or shift would be better |
I get what you're doing now that you've explained it. I'd go with x0r after what Aviar said. |
What would you rate the ease of breaking it? Just a rough guesstimate out of 10? I'm thinking 4 ish.
Also how exactly WOULD you crack it? Finding the difference between two messages? or xoring two messages of similar length(the length will change the final key) to get the key.. | out of 10
10 being what |
Impossible
1 being a caeser cipher shifted by 1. Hello -> Ifmmp
|
|
| Back to top |
|
 |
Aviar³ Grandmaster Cheater
Reputation: 50
Joined: 03 Jan 2008 Posts: 655 Location: Canada
|
Posted: Tue Sep 27, 2011 8:38 pm Post subject: |
|
|
| Kazekeil wrote: | | Anarchy wrote: | | Kazekeil wrote: | | Augustine wrote: | | Kazekeil wrote: | Just posting this in case.
Final Key Building:
Small key(SK) is entered, "TEST" in this case. Also a shift is entered, 3 in this case.
The final size of the final key(FK) is SKlength X 2^L
L is the level of the FK. The user entered value is level 0.
To build the FK, the nth character of the SK is shifted by the amount shift, then added to the FK. Then the character at n+2 is tacked on without a shift. This continues at each character until the last character.
(T+3)S(E+3)T(S+3)T(T+3)E
WSATVTWE
You can see that with the last 2 characters, n+2 is nonexistant, so the program "wraps" around the key.
Then this new key(NK) is WSATVTWE. This is reversed and set as the new SK so that the process may repeat. EWTVTASW
(E+3)T(W+3)V(T+3)T(V+3)A(T+3)S(A+3)W(S+3)E(W+3)W
ATZVWTYAWSDWVEZW
This entire process continues until a FK is produced with a length greater than or equal to the plaintext.
EDIT: @Augustine, this isn't for a client or serious personal use, it's more of just something to keep me from staring at the ceiling in my boring classes today. I was just curious if xor or shift would be better |
I get what you're doing now that you've explained it. I'd go with x0r after what Aviar said. |
What would you rate the ease of breaking it? Just a rough guesstimate out of 10? I'm thinking 4 ish.
Also how exactly WOULD you crack it? Finding the difference between two messages? or xoring two messages of similar length(the length will change the final key) to get the key.. | out of 10
10 being what |
Impossible
1 being a caeser cipher shifted by 1. Hello -> Ifmmp |
You have a long way to go, everyone knows real programmers start counting from 0. Also I didnt get your add request.
_________________
This is the inception of deception, checking the depth of your perception.
 |
|
| Back to top |
|
 |
Anarchy Expert Cheater
Reputation: 29
Joined: 15 Feb 2009 Posts: 104 Location: There.
|
Posted: Tue Sep 27, 2011 8:41 pm Post subject: |
|
|
| Kazekeil wrote: | | Anarchy wrote: | | Kazekeil wrote: | | Augustine wrote: | | Kazekeil wrote: | Just posting this in case.
Final Key Building:
Small key(SK) is entered, "TEST" in this case. Also a shift is entered, 3 in this case.
The final size of the final key(FK) is SKlength X 2^L
L is the level of the FK. The user entered value is level 0.
To build the FK, the nth character of the SK is shifted by the amount shift, then added to the FK. Then the character at n+2 is tacked on without a shift. This continues at each character until the last character.
(T+3)S(E+3)T(S+3)T(T+3)E
WSATVTWE
You can see that with the last 2 characters, n+2 is nonexistant, so the program "wraps" around the key.
Then this new key(NK) is WSATVTWE. This is reversed and set as the new SK so that the process may repeat. EWTVTASW
(E+3)T(W+3)V(T+3)T(V+3)A(T+3)S(A+3)W(S+3)E(W+3)W
ATZVWTYAWSDWVEZW
This entire process continues until a FK is produced with a length greater than or equal to the plaintext.
EDIT: @Augustine, this isn't for a client or serious personal use, it's more of just something to keep me from staring at the ceiling in my boring classes today. I was just curious if xor or shift would be better |
I get what you're doing now that you've explained it. I'd go with x0r after what Aviar said. |
What would you rate the ease of breaking it? Just a rough guesstimate out of 10? I'm thinking 4 ish.
Also how exactly WOULD you crack it? Finding the difference between two messages? or xoring two messages of similar length(the length will change the final key) to get the key.. | out of 10
10 being what |
Impossible
1 being a caeser cipher shifted by 1. Hello -> Ifmmp | at first I was really confused
I didn't realize you were answering my question.
.-.
|
|
| Back to top |
|
 |
Evil_Intentions Expert Cheater
Reputation: 65
Joined: 07 Jan 2010 Posts: 214
|
Posted: Tue Sep 27, 2011 8:45 pm Post subject: |
|
|
| Aviar³ wrote: | | Kazekeil wrote: | | Anarchy wrote: | | Kazekeil wrote: | | Augustine wrote: | | Kazekeil wrote: | Just posting this in case.
Final Key Building:
Small key(SK) is entered, "TEST" in this case. Also a shift is entered, 3 in this case.
The final size of the final key(FK) is SKlength X 2^L
L is the level of the FK. The user entered value is level 0.
To build the FK, the nth character of the SK is shifted by the amount shift, then added to the FK. Then the character at n+2 is tacked on without a shift. This continues at each character until the last character.
(T+3)S(E+3)T(S+3)T(T+3)E
WSATVTWE
You can see that with the last 2 characters, n+2 is nonexistant, so the program "wraps" around the key.
Then this new key(NK) is WSATVTWE. This is reversed and set as the new SK so that the process may repeat. EWTVTASW
(E+3)T(W+3)V(T+3)T(V+3)A(T+3)S(A+3)W(S+3)E(W+3)W
ATZVWTYAWSDWVEZW
This entire process continues until a FK is produced with a length greater than or equal to the plaintext.
EDIT: @Augustine, this isn't for a client or serious personal use, it's more of just something to keep me from staring at the ceiling in my boring classes today. I was just curious if xor or shift would be better |
I get what you're doing now that you've explained it. I'd go with x0r after what Aviar said. |
What would you rate the ease of breaking it? Just a rough guesstimate out of 10? I'm thinking 4 ish.
Also how exactly WOULD you crack it? Finding the difference between two messages? or xoring two messages of similar length(the length will change the final key) to get the key.. | out of 10
10 being what |
Impossible
1 being a caeser cipher shifted by 1. Hello -> Ifmmp |
You have a long way to go, everyone knows real programmers start counting from 0. Also I didnt get your add request. |
ohu
and I copypastad your email .___.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|