Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to decrypt a database if I know the encrypted and decrypted state of the data? We have old software at work (VB) that needs rewriting, problem is that the database is encrypted. I can query the old software for individual entries, and see the corresponding encrypted data in the DB, but the database is about 1000 entries long and I wouldn't want to do this by hand. I can give you some examples:

Unencrypted Data   Corresponding encrypted data
0264/592636        /2Q0Z3MfVTGAgILN2krVfmp+lYs=
0264/591410        /2Q0Z3MfVTGAlWGWetMmvNarF6s=
0264/591548        /2Q0Z3MfVTGAlWNdmW96pgsiQxE=
0264/402559        /2Q0Z3MfUzia9nqAJug5dVxNbto=
0364/888890        /2Q0Z3MfakAgSr1LCbMmjJ6D6tM=
share|improve this question
The encryption key must be there somewhere. – ewanm89 Nov 10 '12 at 12:33
I can tell you, however it's encrypted it's vulnerable to a dictionary attack, as 0264/ encrypts to the same thing each time. – ewanm89 Nov 10 '12 at 12:47
But much easier to find the VB code that does the encrypting/decrypting – ewanm89 Nov 10 '12 at 12:49
@ewanm89 Actually, 0364/ also encrypts to the same, assuming it's not a typo. – Luc Nov 10 '12 at 15:37
@Luc sure that isn't a typo as the VTGA also matches the 59... – ewanm89 Nov 10 '12 at 15:38

There are three solutions here:

  1. Try to find the encryption method. It can be something custom, it can be encrypted in all sorts of weird ways, and you might need a key from somewhere. This is what you are trying to do now.
  2. Find the code that encrypts/decrypts the data.
  3. Write a script that simply calls the decrypt function for all records.

I'm not sure which is easier, 2 or 3, but trying to figure out what kinda code this is doesn't seem like the way to go.

Moreover, this is a problem specifically for you. It's not useful for future readers if it was solved using solution 1, thus the question would be closed as too localized.

I don't know why you didn't try solution 2 actually, can't you read VB well enough to find it or so? I don't mean it accusing, but if you can't find the code or script something to fix it (solution 3), you might want to find someone who can. It would probably save you (and anyone trying to find what encryption it is) a lot of time.

share|improve this answer
Hi Luc, thanks for your answer. I'd love to look at the old VB code, however, the sources left 5 years ago, with the guy that wrote them. So I'll admit to being lazy occasionally, but that's not the reason I didn't try looking at the sources :-). Thank you for your other suggestions though. – Mike Nov 10 '12 at 18:23
@Mike even if you don't have the sources it may be possible to reverse engineer the binaries – Zzz Nov 10 '12 at 18:49
@Mike You could also try contacting him. – Luc Nov 10 '12 at 22:48

Ok sorry now I got your task. You basically want to find the Key right??? This is not an easy task even if you have matching plaintext-ciphertext pairs. It falls in the area of cryptanalysis which is a topic of its own. You can read about it for further details.

share|improve this answer
Only have to find a key if applicable. We don't even know if it's an encryption algorithm, or merely a form of encoding. Gotta figure out what converted the data it in the first place. – Luc Nov 11 '12 at 17:03
@green: This kind of questions/comments should not go into an answer itself, but should be attached to the question as a comment. – Manuel Faux Nov 14 '12 at 16:36

Your Answer


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.