3
$\begingroup$

I have some pairs of plaintext and ciphertext data, from which I need to be able to decrypt the other passwords stored in the database.

The password field typically contains something like

  • ENC:LCznyFywN+3J+AD330rqHg==
  • ENC:D3H2ODVCAzkzQzRr8ZbJdw==

The raw data for the first is 1234, and the second 62369. ENC: denotes that it is an encrypted field, and the == at the end is always the same (no matter what the password).

If this can be done, then any prods in the right direction would be greatly received.

$\endgroup$
3
  • 1
    $\begingroup$ I doubt they're actually encrypted. More likely, it's a salted hash, which is intentionally selected because it is irreversible. $\endgroup$ Commented Oct 19, 2011 at 23:42
  • $\begingroup$ The third parties, have been able to give me my password hence my assumption that it is encrypted rather than a salted hash. $\endgroup$
    – CYMR0
    Commented Oct 20, 2011 at 5:13
  • $\begingroup$ Thanks everybody. I know little about the world of crypto, so you have saved me from trying to complete an impossible task! $\endgroup$
    – CYMR0
    Commented Oct 20, 2011 at 5:19

2 Answers 2

5
$\begingroup$

There is no general method for that. Cryptography is about making it impossible in practice.

In the particular examples, it looks like "encrypted data" is encoded in Base64, as 22 characters, representing 128 arbitrary bits. From that it can't be deduced much about the scheme used.

$\endgroup$
0
4
$\begingroup$

What you are trying to do is called a known-plaintext attack.

A proper cipher will not be susceptible to a known-plaintext attack, so if the encryption method used on the strings in your database is any good, it can't be done.

Imagine that you were in fact using a (128 bit block) cipher that permits deducting the password given the plaintext and the ciphertext and you decide to use it to send encrypted emails to somebody.

If another person knows that your email ends with

Sincerely yours,

CYMR0

since this string is over 128 bits long, he can recover the password and, therefore, decrypt the entire email.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.