Send 2way password encrypted field to a MID Server for use and decryption

NStefanisko
Tera Expert

I've got a situation where I need to put a password into the payload of an ECC queue record. Now, obviously, I do not want it in clear text, and I'd really rather it by properly encrypted rather than just base64 encoded. So I need an encrypt on the ECC side and a decrypt in Java (jar) on the MID Server side that can work together. Are there built in functions to do that or do I have to reinvent something that looks a lot like a wheel?

1 ACCEPTED SOLUTION

NStefanisko
Tera Expert

I think I may have figured out my own problem. And maybe this is documented somewhere, but there is a JAR version of the GlideEncrypter. Using a background script I pulled the encrypted value from the password2 field I was trying to decrypt from my table. It comes out as a base64 encoded string. If you just unencode the base64, you get a binary value. So it isn't just encoded, it really is encrypted. Using the javascript getDecryptedValue() method of the field in a background script decrypts the data as "my password". So that is the clear text value I am looking for. It is also what I typed into the field, so that's good. Getting out what I put in.

Wrote myself a quick Java program using the JAR files from my MID Server, specifically commons-glide.jar, which contains com.glide.util.Encrypter. Using that same base64 encoded string:  "goE6RhWh4iMFHK4kbn6s3Q==", I ran my program and out popped "my password".

import com.glide.util.Encrypter;

public class sncrypt {

	public static void main(String[] args) throws Exception {
		
		Encrypter enc = new Encrypter();	

		String unclear = "goE6RhWh4iMFHK4kbn6s3Q=="; 
		String clear = enc.decrypt(unclear);
		
		System.out.println(clear);
	}
}

View solution in original post

1 REPLY 1

NStefanisko
Tera Expert

I think I may have figured out my own problem. And maybe this is documented somewhere, but there is a JAR version of the GlideEncrypter. Using a background script I pulled the encrypted value from the password2 field I was trying to decrypt from my table. It comes out as a base64 encoded string. If you just unencode the base64, you get a binary value. So it isn't just encoded, it really is encrypted. Using the javascript getDecryptedValue() method of the field in a background script decrypts the data as "my password". So that is the clear text value I am looking for. It is also what I typed into the field, so that's good. Getting out what I put in.

Wrote myself a quick Java program using the JAR files from my MID Server, specifically commons-glide.jar, which contains com.glide.util.Encrypter. Using that same base64 encoded string:  "goE6RhWh4iMFHK4kbn6s3Q==", I ran my program and out popped "my password".

import com.glide.util.Encrypter;

public class sncrypt {

	public static void main(String[] args) throws Exception {
		
		Encrypter enc = new Encrypter();	

		String unclear = "goE6RhWh4iMFHK4kbn6s3Q=="; 
		String clear = enc.decrypt(unclear);
		
		System.out.println(clear);
	}
}