<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Password storage Approach Environment wise (one time) - Context in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Password-storage-Approach-Environment-wise-one-time-Context/m-p/2322579#M92508</link>
    <description>&lt;P&gt;I am not entirely sure of what the requirement is here. Are you trying to store the DB connection details in the DB that you need to connect to? Or are you trying to store other passwords in the DB and you don't want them to be viewed by others in clear text? Either way, this routine may help you to find a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have written a Talend routine (essentially a Java class) which will allow you to encrypt and decrypt your password (or any other String) text at runtime. The code is below.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;package&lt;/B&gt; routines;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;import&lt;/B&gt; org.jasypt.encryption.pbe.StandardPBEStringEncryptor;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;public&lt;/B&gt; &lt;B&gt;class&lt;/B&gt; JasyptEncryptionUtils {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;	&lt;B&gt;private&lt;/B&gt; &lt;B&gt;static&lt;/B&gt; StandardPBEStringEncryptor setEncryptor(String password) {&lt;/P&gt;&lt;P&gt;		StandardPBEStringEncryptor encryptor = &lt;B&gt;new&lt;/B&gt; StandardPBEStringEncryptor();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	encryptor.setPassword(password);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	encryptor.setAlgorithm("PBEWithMD5AndTripleDES");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	&lt;B&gt;return&lt;/B&gt; encryptor;&lt;/P&gt;&lt;P&gt;	}&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;B&gt;public&lt;/B&gt; &lt;B&gt;static&lt;/B&gt; String encrypt(String data, String password) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	StandardPBEStringEncryptor encryptor = &lt;I&gt;setEncryptor&lt;/I&gt;(password);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	&lt;B&gt;return&lt;/B&gt; encryptor.encrypt(data);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;B&gt;public&lt;/B&gt; &lt;B&gt;static&lt;/B&gt; String decrypt(String data, String password) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	StandardPBEStringEncryptor encryptor = &lt;I&gt;setEncryptor&lt;/I&gt;(password);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	&lt;B&gt;return&lt;/B&gt; encryptor.decrypt(data);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will need to create a routine with the name of the class seen above, paste this code in and add the Jasypt library to the routine. This is shown below.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000UzUTeAAN.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152689i3866807C08E01CD7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000UzUTeAAN.png" alt="0695b00000UzUTeAAN.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then all you do is use the "encrypt" method to encrypt a String and the "decrypt" method to decrypt your String. &lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2022 13:02:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-15T13:02:51Z</dc:date>
    <item>
      <title>Password storage Approach Environment wise (one time) - Context</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Password-storage-Approach-Environment-wise-one-time-Context/m-p/2322578#M92507</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to Talend and working on one flow where My source is MYSQL and need to store all the details like host, username, password into context &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/67142"&gt;@Db&lt;/a&gt; level. But if I stored the context for password in DB then need to store as hardcode value which is not correct way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me? What is the way to store a password so that I can use it in a Talend job?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 22:33:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Password-storage-Approach-Environment-wise-one-time-Context/m-p/2322578#M92507</guid>
      <dc:creator>BA621858188</dc:creator>
      <dc:date>2024-11-15T22:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Password storage Approach Environment wise (one time) - Context</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Password-storage-Approach-Environment-wise-one-time-Context/m-p/2322579#M92508</link>
      <description>&lt;P&gt;I am not entirely sure of what the requirement is here. Are you trying to store the DB connection details in the DB that you need to connect to? Or are you trying to store other passwords in the DB and you don't want them to be viewed by others in clear text? Either way, this routine may help you to find a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have written a Talend routine (essentially a Java class) which will allow you to encrypt and decrypt your password (or any other String) text at runtime. The code is below.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;package&lt;/B&gt; routines;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;import&lt;/B&gt; org.jasypt.encryption.pbe.StandardPBEStringEncryptor;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;public&lt;/B&gt; &lt;B&gt;class&lt;/B&gt; JasyptEncryptionUtils {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;	&lt;B&gt;private&lt;/B&gt; &lt;B&gt;static&lt;/B&gt; StandardPBEStringEncryptor setEncryptor(String password) {&lt;/P&gt;&lt;P&gt;		StandardPBEStringEncryptor encryptor = &lt;B&gt;new&lt;/B&gt; StandardPBEStringEncryptor();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	encryptor.setPassword(password);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	encryptor.setAlgorithm("PBEWithMD5AndTripleDES");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	&lt;B&gt;return&lt;/B&gt; encryptor;&lt;/P&gt;&lt;P&gt;	}&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;B&gt;public&lt;/B&gt; &lt;B&gt;static&lt;/B&gt; String encrypt(String data, String password) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	StandardPBEStringEncryptor encryptor = &lt;I&gt;setEncryptor&lt;/I&gt;(password);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	&lt;B&gt;return&lt;/B&gt; encryptor.encrypt(data);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;B&gt;public&lt;/B&gt; &lt;B&gt;static&lt;/B&gt; String decrypt(String data, String password) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	StandardPBEStringEncryptor encryptor = &lt;I&gt;setEncryptor&lt;/I&gt;(password);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;	&lt;B&gt;return&lt;/B&gt; encryptor.decrypt(data);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will need to create a routine with the name of the class seen above, paste this code in and add the Jasypt library to the routine. This is shown below.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000UzUTeAAN.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152689i3866807C08E01CD7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000UzUTeAAN.png" alt="0695b00000UzUTeAAN.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then all you do is use the "encrypt" method to encrypt a String and the "decrypt" method to decrypt your String. &lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 13:02:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Password-storage-Approach-Environment-wise-one-time-Context/m-p/2322579#M92508</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-15T13:02:51Z</dc:date>
    </item>
  </channel>
</rss>

