Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Encryption & decryption using Talend and MySQL db

Hello.

My question is if there is any solution to encrypt/decrypt the data in talend but without putting my password in clear in the code java because all the solution that i saw you need to put either your password or the key used to encrypt in the code in clear (For example tEncryptColumn /tDecryptColumn , JavaXCrypto,Jasypt ...) so i was wondering if there's any solution to do that . 
For example: tMysqlInput -------Decrypt---------> Tmap --------Encrypt-------> tMysqlOutput

For the DB I'm using MySQL. 

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

You need to either supply the full path to the Java class or import it.

View solution in original post

5 Replies
Anonymous
Not applicable
Author

This is very easy to implement using Jasypt (http://www.jasypt.org/) and system environment variables. On the machines running your jobs you can set up system environment variables which hold your passwords (or passwords to decrypt secondary passwords stored elsewhere for extra obfuscation), then in your jobs use Jasypt to encrypt/decrypt your data. It requires a bit of Java, but it really isn't that difficult to achieve. Jasypt is actually supplied with Talend, so you shouldn't need to download anything for this.

Anonymous
Not applicable
Author

Thank you for replying  

 

My question is how to make the connection between my system environment variables and  Jasyp in talend . do i need to create new contexte ? 

 

Anonymous
Not applicable
Author

This code is from a routine I use in my Talend jobs......

 

public static String getEnvironmentVariable(String variableName) {
		String returnVal = System.getenv(variableName);

		if (returnVal == null) {
			System.out.println(variableName
					+ " does not exist or holds no value");
		}

		return returnVal;
	}
Anonymous
Not applicable
Author

thank you for the example

So i wrote a java code  and i'm getting this error :  StandardPBEStringEncryptor cannot be resolved to a type : 

this is m'y code : 


String mdp = System.getenv("MDP");

if (mdp == null) {
System.out.println(
" does not exist");
} else System.out.println(mdp);

 

StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
encryptor.setPassword(mdp); // we HAVE TO set a password
encryptor.setAlgorithm("PBEWithMD5AndTripleDES");


String encryptedText = encryptor.encrypt(row2.libelle_bu);

 

Anonymous
Not applicable
Author

You need to either supply the full path to the Java class or import it.