Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

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.

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

2 Answers 2

up vote 5 down vote accepted

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.

share|improve this answer
    
Thanks @fgrieu , it was worth a shot –  CYMR0 Oct 20 '11 at 5:17

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.

share|improve this answer
    
Thanks anyway @dennis –  CYMR0 Oct 20 '11 at 5:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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