<?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: Utility - Encryption VBO 'Bad Length' error message in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92529#M42298</link>
    <description>Thank you Eric,&lt;BR /&gt;&lt;BR /&gt;I am using a 256 byte Key, and as the text I am trying to encode is already Base64 encoded, then I believe I should be able to encode up to 245 characters based on the above?&lt;BR /&gt;&lt;BR /&gt;If so, then I have clearly got something wrong as the header and payload together I was trying to encode exceeded this size, however, I'm still not sure why the VBO seems to only be allowing about 214 characters of Base64 encoded text, rather than 245?&lt;BR /&gt;&lt;BR /&gt;Many thanks&lt;BR /&gt;Tony&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Tony Hann&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Mon, 09 May 2022 17:32:00 GMT</pubDate>
    <dc:creator>TonyHann</dc:creator>
    <dc:date>2022-05-09T17:32:00Z</dc:date>
    <item>
      <title>Utility - Encryption VBO 'Bad Length' error message</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92525#M42294</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am having an issue with the Utility Encryption VBO, and was wondering if anyone has any ideas or suggestions?&lt;BR /&gt;&lt;BR /&gt;I have the inputs to the VBO set up as per the below:-&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="29712.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/29842i7FE79F4DB71E5E1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="29712.png" alt="29712.png" /&gt;&lt;/span&gt;&lt;BR /&gt;I am receiving the below error when I try to encrypt my text string.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="29713.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/29843i303207FC11B42338/image-size/large?v=v2&amp;amp;px=999" role="button" title="29713.png" alt="29713.png" /&gt;&lt;/span&gt;&lt;BR /&gt;I believe that this is to do with the length of the text string I am trying to encrypt (approx. 300 characters) as if I enter the below, this works fine:-&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="29714.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/29850iAEF3E3F0A6E1E51C/image-size/large?v=v2&amp;amp;px=999" role="button" title="29714.png" alt="29714.png" /&gt;&lt;/span&gt;&lt;BR /&gt;From trial and error, it seems to me that the VBO will successfully encrypt&amp;nbsp; and text provided up to 214 characters, when trying a 215 character string, the below error was generated, and any string over 215 characters returned the 'Bad Length' error&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="29715.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/29851i5F235DBEF787F169/image-size/large?v=v2&amp;amp;px=999" role="button" title="29715.png" alt="29715.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Unfortunately, splitting my text into smaller segments isn't an option, as I am attempting to use the encryption object to create a JSON Web Signature and need to encode my header and payload together.&lt;BR /&gt;&lt;BR /&gt;Is this an error with the object, or is there a limit to how long a text string I should be able to encode?&lt;BR /&gt;&lt;BR /&gt;I get the same issue irrespective of if I use my own Key (which is what I need to do), or leaving the key blank to allow the object to generate one for me - both fail at the same text length.&lt;BR /&gt;&lt;BR /&gt;Any ideas or suggestions would be welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Many thanks&lt;BR /&gt;Tony&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Tony Hann&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 09 May 2022 12:45:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92525#M42294</guid>
      <dc:creator>TonyHann</dc:creator>
      <dc:date>2022-05-09T12:45:00Z</dc:date>
    </item>
    <item>
      <title>RE: Utility - Encryption VBO 'Bad Length' error message</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92526#M42295</link>
      <description>Hi &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/1201"&gt;@TonyHann&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Which version of the &lt;STRONG&gt;Utility - Encryption&lt;/STRONG&gt; VBO are you using? The last time I checked it only supported &lt;EM&gt;&lt;STRONG&gt;AES&lt;/STRONG&gt;&lt;/EM&gt;, &lt;EM&gt;&lt;STRONG&gt;TDES&lt;/STRONG&gt;&lt;/EM&gt;, and &lt;EM&gt;&lt;STRONG&gt;Rjindael&lt;/STRONG&gt;&lt;/EM&gt; as input for the algorithm.&lt;BR /&gt;&lt;BR /&gt;Cheers,​&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Eric Wilson&lt;BR /&gt;Director, Integrations and Enablement&lt;BR /&gt;Blue Prism Digital Exchange&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 09 May 2022 13:38:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92526#M42295</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2022-05-09T13:38:00Z</dc:date>
    </item>
    <item>
      <title>RE: Utility - Encryption VBO 'Bad Length' error message</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92527#M42296</link>
      <description>&lt;BR /&gt;Hi Eric,&lt;BR /&gt;&lt;BR /&gt;Many thanks for taking the time to reply,&lt;BR /&gt;&lt;BR /&gt;I'm using the current version from the DX, its showing as version 1.0.0 - but appears to have been updated about a fortnight ago,&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="29679.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/29815iEE1B393B5F6CEBE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="29679.png" alt="29679.png" /&gt;&lt;/span&gt;&lt;BR /&gt;It mentions supporting RSA in the description, and has been updated with a relevant code stage :-&lt;BR /&gt;It seems to work absolutely fine, providing the text you are trying to encrypt is less than 214 characters.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="29680.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/29813iADAE1790BCDAAB0F/image-size/large?v=v2&amp;amp;px=999" role="button" title="29680.png" alt="29680.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Many thanks&lt;BR /&gt;Tony&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Tony Hann&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 09 May 2022 13:59:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92527#M42296</guid>
      <dc:creator>TonyHann</dc:creator>
      <dc:date>2022-05-09T13:59:00Z</dc:date>
    </item>
    <item>
      <title>RE: Utility - Encryption VBO 'Bad Length' error message</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92528#M42297</link>
      <description>&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/1201"&gt;@TonyHann&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Seems you are correct, and I am behind. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I'll have to talk to the developer though as the version information should have been incremented with the addition of support for RSA.&lt;BR /&gt;&lt;BR /&gt;With that said, the RSA algorithm is limited to how much data it can successfully encrypt, and that length is tied to the length of the key too. It looks like you are supplying your own key, correct? If you provide a key of say 256 bytes (2048 bits), you should be able to encrypt up to 245 bytes of data. With a key of 128 bytes (1024 bits), you could encrypt about 117 bytes of data. &lt;BR /&gt;&lt;BR /&gt;You can calculate the maximum size of the data that can be encrypted, based on the size of the key, using the following formula:&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;((KEY_SIZE_IN_BITS - 384) / &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; + 37&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Eric Wilson&lt;BR /&gt;Director, Integrations and Enablement&lt;BR /&gt;Blue Prism Digital Exchange&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 09 May 2022 14:45:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92528#M42297</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2022-05-09T14:45:00Z</dc:date>
    </item>
    <item>
      <title>RE: Utility - Encryption VBO 'Bad Length' error message</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92529#M42298</link>
      <description>Thank you Eric,&lt;BR /&gt;&lt;BR /&gt;I am using a 256 byte Key, and as the text I am trying to encode is already Base64 encoded, then I believe I should be able to encode up to 245 characters based on the above?&lt;BR /&gt;&lt;BR /&gt;If so, then I have clearly got something wrong as the header and payload together I was trying to encode exceeded this size, however, I'm still not sure why the VBO seems to only be allowing about 214 characters of Base64 encoded text, rather than 245?&lt;BR /&gt;&lt;BR /&gt;Many thanks&lt;BR /&gt;Tony&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Tony Hann&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 09 May 2022 17:32:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92529#M42298</guid>
      <dc:creator>TonyHann</dc:creator>
      <dc:date>2022-05-09T17:32:00Z</dc:date>
    </item>
    <item>
      <title>RE: Utility - Encryption VBO 'Bad Length' error message</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92530#M42299</link>
      <description>&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/1201"&gt;@TonyHann&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;After looking at the code, the actual call to the underlying &lt;EM&gt;&lt;STRONG&gt;RSACryptoServiceProvider.Encrypt()&lt;/STRONG&gt;&lt;/EM&gt; method is using OAEP padding as opposed to PKCS#1 v1.5. The formula I provided above is based on using PKCS#1 v1.5. For OAEP padding, the formula would be:&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;(KEY_SIZE_IN_BITS / &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; - 42&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; ​​​&lt;BR /&gt;&lt;BR /&gt;So in your case that would give you (2048 / &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; - 42 = &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;214&lt;/STRONG&gt;&lt;/SPAN&gt; bytes.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Eric Wilson&lt;BR /&gt;Director, Integrations and Enablement&lt;BR /&gt;Blue Prism Digital Exchange&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 09 May 2022 18:06:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Utility-Encryption-VBO-Bad-Length-error-message/m-p/92530#M42299</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2022-05-09T18:06:00Z</dc:date>
    </item>
  </channel>
</rss>

