<?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: Python SDK - decrypting password from HTML GUI in Dev Space</title>
    <link>https://community.alteryx.com/t5/Dev-Space/Python-SDK-decrypting-password-from-HTML-GUI/m-p/376062#M792</link>
    <description>&lt;P&gt;Thank you for clarification&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/17471"&gt;@wthompson&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the setup above, when I try to upload the workflow to the private Gallery in the cloud, I'm getting the error, even though it works fine locally.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;RuntimeError: InternalError: DecryptPassword - buffer too small.&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;In the docs, it's says 'machine' encryption is recommended to upload workflows to the Gallery. Is there other ways to store secrets between environments?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Feb 2019 16:21:38 GMT</pubDate>
    <dc:creator>pavloko</dc:creator>
    <dc:date>2019-02-21T16:21:38Z</dc:date>
    <item>
      <title>Python SDK - decrypting password from HTML GUI</title>
      <link>https://community.alteryx.com/t5/Dev-Space/Python-SDK-decrypting-password-from-HTML-GUI/m-p/375062#M788</link>
      <description>&lt;P&gt;Hello folks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For those of you who have troubles with encryption/decryption of your secrets between HTML and Python SDKs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I found that &lt;A href="https://help.alteryx.com/developer/current/Python/use/AlteryxEngineClass.htm?tocpath=SDKs%7CBuild%20Custom%20Tools%7CPython%20SDK%7CClasses%7CAlteryxEngine%7C_____0" target="_self"&gt;documentation describing different states of encryption&lt;/A&gt; is wrong about the modes.&lt;BR /&gt;&lt;BR /&gt;'machine' encryption specified in HTML corresponds to 0 in Python decrypt_password.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;window.Alteryx.Gui.Utils.Functions
     .postJsEventWithCallback('Encrypt',  { text: this.state.apiToken, encryptionMode: 'machine' }, encryptedToken =&amp;gt; {
         console.log(encryptedToken)&lt;BR /&gt;       })&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;to decrypt the token you would need to use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;self.alteryx_engine.decrypt_password(config.token, 0)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 15:58:21 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/Python-SDK-decrypting-password-from-HTML-GUI/m-p/375062#M788</guid>
      <dc:creator>pavloko</dc:creator>
      <dc:date>2019-02-20T15:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Python SDK - decrypting password from HTML GUI</title>
      <link>https://community.alteryx.com/t5/Dev-Space/Python-SDK-decrypting-password-from-HTML-GUI/m-p/375157#M789</link>
      <description>&lt;P&gt;The documentation is correct.&amp;nbsp; The confusion may be in the name of the method &lt;STRONG&gt;decrypt_password&lt;/STRONG&gt;, because it is used to both encrypt and decrypt a password.&amp;nbsp; To encrypt a password, the user would set mode to either 2 or 3 and the encrypted_password would be a non-encrypted string.&amp;nbsp; To decrypt an encrypted password, the user would set mode to 0 and the encrypted_password would be an encrypted string from a previous Machine(2) or User(3) mode encryption.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Returns a string of &lt;STRONG&gt;encrypted&lt;/STRONG&gt; or &lt;STRONG&gt;decrypted&lt;/STRONG&gt; text. Works with user and machine encryption.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="pln"&gt;decrypt_password&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;encrypted_password&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; mode&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; str &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="code"&gt;encrypted_password&lt;/SPAN&gt;: The text to be treated.&lt;/P&gt;&lt;P&gt;Supported options include:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="code"&gt;0&lt;/SPAN&gt;: Decrypt.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="code"&gt;2&lt;/SPAN&gt;: Machine encryption&lt;/P&gt;&lt;P&gt;&lt;SPAN class="code"&gt;3&lt;/SPAN&gt;: User encryption&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 17:27:18 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/Python-SDK-decrypting-password-from-HTML-GUI/m-p/375157#M789</guid>
      <dc:creator>wthompson</dc:creator>
      <dc:date>2019-02-20T17:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python SDK - decrypting password from HTML GUI</title>
      <link>https://community.alteryx.com/t5/Dev-Space/Python-SDK-decrypting-password-from-HTML-GUI/m-p/376062#M792</link>
      <description>&lt;P&gt;Thank you for clarification&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/17471"&gt;@wthompson&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the setup above, when I try to upload the workflow to the private Gallery in the cloud, I'm getting the error, even though it works fine locally.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;RuntimeError: InternalError: DecryptPassword - buffer too small.&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;In the docs, it's says 'machine' encryption is recommended to upload workflows to the Gallery. Is there other ways to store secrets between environments?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 16:21:38 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/Python-SDK-decrypting-password-from-HTML-GUI/m-p/376062#M792</guid>
      <dc:creator>pavloko</dc:creator>
      <dc:date>2019-02-21T16:21:38Z</dc:date>
    </item>
  </channel>
</rss>

