Symetric encryption by VB and decryption by Java.
843810Jan 15 2003 — edited May 14 2003Good afternoon Ladies and Gentlemen,
I have been trawling through the forums and the Web for the last three days and more trying to find the solution to my problem. In theory it�s very simple, but I cannot write a working solution or find a coded solution on the Net.
We have the following requirement:
1. Encrypt a username and a password entered in plain text, in a �recognised� symmetric cipher (DES preferably).
2. Send them to a SQL database.
3. Retrieve them using a Java application and decrypt them (then re-encrypt them and send them back to the d/b if they are updated).
We are using the Microsoft Crypto API on Windows, and the Sun JCE with Java (1.3.1_06).
However, whilst I can get VB and Java to encrypt and decrypt alone OK, I cannot get something encrypted using VB to decrypt within Java. I have 'hard coded' the encrypted data into my Java application, taking great care that the data is identical at the bit level (Hard coding the data is the easiest way of testing as I don't yet have a database with these fields in it).
There seem to be a lot of postings on this subject but none of the code fragments help with our problem.
It should be possible to encrypt data on one system and decrypt it on another without worrying about the underlying hardware or software. Many of the postings recommend re-ordering the bytes within the encrypted data, but I can�t get this to make any difference and even if this fixes it, then the �decrypter� will have to know what type of system encrypted it.
I have very little hair left to tear out, so for my bald head�s sake, can anyone please help me?
Thank you, Andrew from Down Under. (a bald head is no fun in the Australian sun, I speak from experience)