Aroniaina - 9 months ago 83

Java Question

I heard about K9 encryption, but I don't know which type of encryption is it and how it work. I just see one example in one site but cant decode the full logic.

**ENCRYPTED :** 8430727796730470662453

**DECRYPTED :** the password is mobile

The algo use number association which use something like :

`0 => _space`

1 => ’

2 => ABC

3 => DEF

4 => GHI

5 => JKL

6 => MNO

7 => PQRS

8 => TUV

9 => WXYZ

So, what is the full logic? and can someone provide an encryption code with JAVA or Javascript or PHP.

`8430727796730470662453`

Answer Source

I'd say that this is not an encryption algorithm but rather a very, very simple hashing algorithm.

The hashing is easy.

- Take a letter from the given string
- Determine the number for that letter
- Add that number to the output

Restoring the original is not possible, as for every number (apart from 0) there are at least 3 possible characters.

For example, another possible decrypted password for your above example would also be: `UGE PAQRWOSE GR ONAGJF`

.

And that is also the problem with this algorithm: Unlike other secure hashing algorithms, it reduces the number of tries required to find a valid password for the given hash immensely, because many, many different inputs can create the same output, so trying to crack a password, you have many more chances to hit the right "hash" even when the actual password is wrong.

Example: Instead of "THE PASSWORD IS MOBILE" also "UGE PAQRWOSE GR ONAGJF" and many other combinations of letters would be accepted as the correct password.

So while this may be nice to teach children about hashing, please don't use this is a real-world application...

There is no real "one answer" solution to the challenge you linked. If it is not a fraud, any combination of letters that lead to the given number must be deemed valid solutions. Of course "THE PASSWORD IS MOBILE" is **one of them**.

Without the additional information that the password must be a valid English sentence, this allows for many possible solutions.

Unless they accept any combination of letters that leads to the hash `8430727796730470662453`

as a solution, I can not take that page seriously.