Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

#1
March 15th, 2012, 10:26 PM
 CryptoQuestion
Registered User

Join Date: Mar 2012
Posts: 1
Time spent in forums: 25 m 11 sec
Reputation Power: 0
Crypto Algorithm Evaluation - Interesting numerical hash

I got a numeric string. Decrypted text (plaintext) is not in english, it's in croatian, so it contains some non english chars (link - cannot link it, cause im new here, just google 'croatian alphabet', and head to the wiki result, which was second result on my pc, or just see my php code below).
Every alphabet char is represented by its numeric position key in the alphabet. So, a is 1, b is 2, c is 3 and so forth. Beware the differences between the languages, though, as we don't have q and w, but have some other chars.
The tricky part is that numerals are sortedfrom 0 to 9 (there's a zero because plaintext obviously contains a character which position is 10, 20 or 30).
Here's the encrypted string:
01111111111222223344566689999999 (32 numerals)
This shouldn't be too hard, but beware that frequency analysis is kind of no use here, since all these 1's and 2's are not always a and b, respectively; they can be 12, 13 and so forth. Again, beware the difference between english and our alphabet, number 4 is not d. Plaintext is 20 chars long, excluding spaces, and there are 4 words. No numbers or special chars.
I'm going to start working on it now, jump in if you feel so. Here's some PHP I got so far to help me out (dunno how I am going to use it atm):
PHP Code:
``` <? \$i = 01111111111222223344566689999999; \$s = array( 1 => 'a', 2 => 'b', 3 => 'c', 4 => 'č', 5 => 'ć', 6 => 'd', 7 => 'dž', 8 => 'đ', 9 => 'e', 10 => 'f', 11 => 'g', 12 => 'h', 13 => 'i', 14 => 'j', 15 => 'k', 16 => 'l', 17 => 'lj', 18 => 'm', 19 => 'n', 20 => 'nj', 21 => 'o', 22 => 'p', 23 => 'r', 24 => 's', 25 => 'š', 26 => 't', 27 => 'u', 28 => 'v', 29 => 'z', 30 => 'ž'); \$nn = array('g', 'p'); \$m_0 = array('f', 'nj', 'ž'); \$m_1 = array('a', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'lj', 'm', 'n', 'o'); \$m_2 = array('b', 'h', 'nj', 'o', 'p', 'r', 's', 'š', 't', 'u', 'v', 'z'); \$m_3 = array('c', 'i', 'r', 'ž'); \$m_4 = array('č', 'j', 's'); \$m_5 = array('ć', 'k', 'š'); \$m_6 = array('d', 'l', 't'); \$m_8 = array('đ', 'm', 'v'); \$m_9 = array('e', 'n', 'z'); ?> ```

Let the hacking begin

 Viewing: Dev Shed Forums > System Administration > Security and Cryptography > Crypto Algorithm Evaluation - Interesting numerical hash