<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>AES - RSA hibrid</title><link>https://community.appian.com/discussions/f/plug-ins/39935/aes---rsa-hibrid</link><description>Hi, 
 I&amp;#39;m not very knowledgeable about encryption algorithms, but I&amp;#39;m trying to figure out if I can send a text encrypted in AES (with the Encryption Functions plugin) so that it can be decrypted by a service external to Appian, using RSA. My guess is</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: AES - RSA hibrid</title><link>https://community.appian.com/thread/152457?ContentTypeID=1</link><pubDate>Mon, 17 Nov 2025 17:39:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:38b80e47-c0e2-4650-b164-d57760412c83</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Gemini tells me this:&lt;/p&gt;
&lt;p data-path-to-node="0"&gt;That&amp;#39;s a &lt;b&gt;great question&lt;/b&gt;&amp;nbsp;that gets to the heart of how different encryption methods are often combined!&amp;nbsp;&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f4a1.svg" title="Bulb"&gt;&amp;#x1f4a1;&lt;/span&gt;&lt;/p&gt;
&lt;p data-path-to-node="1"&gt;The short answer is: &lt;b&gt;No, you cannot directly decrypt an AES-encrypted text using an RSA private key.&lt;/b&gt;&lt;/p&gt;
&lt;p data-path-to-node="2"&gt;Your proposed method actually describes a common security practice known as a &lt;b&gt;hybrid encryption scheme&lt;/b&gt;, but it seems there might be a slight misunderstanding of which key encrypts &lt;i&gt;what&lt;/i&gt;.&lt;/p&gt;
&lt;p data-path-to-node="3"&gt;Here&amp;rsquo;s a breakdown of why this is the case and how the process typically works:&lt;/p&gt;
&lt;hr data-path-to-node="4" /&gt;
&lt;p data-path-to-node="5"&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f511.svg" title="Key"&gt;&amp;#x1f511;&lt;/span&gt;&amp;nbsp;Understanding the Encryption Types&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p data-path-to-node="6"&gt;To clarify your goal, let&amp;#39;s look at the two types of encryption you mentioned:&lt;/p&gt;
&lt;p data-path-to-node="7"&gt;&lt;/p&gt;
&lt;h3&gt;1. AES (Symmetric Encryption)&lt;/h3&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul data-path-to-node="8"&gt;
&lt;li&gt;
&lt;p data-path-to-node="8,0,0"&gt;&lt;b&gt;How it works:&lt;/b&gt; Uses a &lt;b&gt;single, shared secret key&lt;/b&gt; for both encryption and decryption. This is called a &lt;b&gt;Symmetric&lt;/b&gt;algorithm.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="8,1,0"&gt;&lt;b&gt;Benefit:&lt;/b&gt; It&amp;#39;s &lt;b&gt;extremely fast&lt;/b&gt; and efficient for encrypting large amounts of data.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="8,2,0"&gt;&lt;b&gt;Drawback:&lt;/b&gt; The sender and receiver must securely exchange the secret key beforehand.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-path-to-node="9"&gt;&lt;/p&gt;
&lt;h3&gt;2. RSA (Asymmetric Encryption)&lt;/h3&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul data-path-to-node="10"&gt;
&lt;li&gt;
&lt;p data-path-to-node="10,0,0"&gt;&lt;b&gt;How it works:&lt;/b&gt; Uses a &lt;b&gt;pair of keys&lt;/b&gt;&amp;mdash;a &lt;b&gt;public key&lt;/b&gt; for encryption (which can be shared widely) and a corresponding &lt;b&gt;private key&lt;/b&gt; for decryption (which must be kept secret). This is called an &lt;b&gt;Asymmetric&lt;/b&gt; or &lt;b&gt;Public-Key&lt;/b&gt; algorithm.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="10,1,0"&gt;&lt;b&gt;Benefit:&lt;/b&gt; It solves the key-exchange problem; anyone can use the public key to send you data only you can read.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="10,2,0"&gt;&lt;b&gt;Drawback:&lt;/b&gt; It is &lt;b&gt;much slower&lt;/b&gt; and less efficient for encrypting large amounts of data compared to AES.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-path-to-node="11" /&gt;
&lt;p data-path-to-node="12"&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f504.svg" title="Arrows counterclockwise"&gt;&amp;#x1f504;&lt;/span&gt;&amp;nbsp;The Hybrid Encryption Solution (How it Should Work)&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p data-path-to-node="13"&gt;Because AES is fast for data and RSA is secure for key exchange, they are combined in a &lt;b&gt;hybrid scheme&lt;/b&gt; to get the benefits of both. This is precisely what happens in secure protocols like TLS/SSL.&lt;/p&gt;
&lt;div class="attachment-container search-images"&gt;
&lt;div class="image-container ng-star-inserted" data-full-size-image-uri="https://encrypted-tbn0.gstatic.com/licensed-image?q=tbn:ANd9GcTJ8i3Po-usIBOysj11Xj8nwjwLx03ZFMooFXvE0SXFQQY34J5Ptqd0ASLW0yGhzs_ktrF9hYO45h4ECHtmsM1yTbaicMoNPcqIyrTtiqSrE5R3CMo"&gt;
&lt;div class="overlay-container ng-star-inserted"&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/19/pastedimage1763401137892v1.jpeg" alt=" " /&gt;
&lt;div class="licensed-image-source ng-star-inserted"&gt;&lt;span class="label ellipsis gds-label-m-alt"&gt;Shutterstock&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p data-path-to-node="15"&gt;Here are the correct steps for what you are trying to achieve:&lt;/p&gt;
&lt;ol start="1" data-path-to-node="16"&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,0,0"&gt;&lt;b&gt;Generate the Session Key (Sender - Appian/Plugin):&lt;/b&gt;&lt;/p&gt;
&lt;ul data-path-to-node="16,0,1"&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,0,1,0,0"&gt;The Appian service first generates a &lt;b&gt;random, single-use AES secret key&lt;/b&gt; (let&amp;#39;s call it the &lt;b&gt;Session Key&lt;/b&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,1,0"&gt;&lt;b&gt;Encrypt the Data (Sender - Appian/Plugin):&lt;/b&gt;&lt;/p&gt;
&lt;ul data-path-to-node="16,1,1"&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,1,1,0,0"&gt;The Appian service uses the &lt;b&gt;Session Key&lt;/b&gt; to encrypt the actual text data via &lt;b&gt;AES&lt;/b&gt;. This results in the &lt;b&gt;encrypted text&lt;/b&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,2,0"&gt;&lt;b&gt;Encrypt the Session Key (Sender - Appian/Plugin):&lt;/b&gt;&lt;/p&gt;
&lt;ul data-path-to-node="16,2,1"&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,2,1,0,0"&gt;The Appian service takes the external service&amp;#39;s &lt;b&gt;RSA Public Key&lt;/b&gt; (stored in the Secure Credential Store) and uses it to encrypt the &lt;b&gt;Session Key&lt;/b&gt; itself. This results in the &lt;b&gt;encrypted key&lt;/b&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,3,0"&gt;&lt;b&gt;Send the Package:&lt;/b&gt;&lt;/p&gt;
&lt;ul data-path-to-node="16,3,1"&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,3,1,0,0"&gt;The Appian service sends &lt;b&gt;two items&lt;/b&gt; to the external service:&lt;/p&gt;
&lt;ul data-path-to-node="16,3,1,0,1"&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,3,1,0,1,0,0"&gt;The &lt;b&gt;AES-encrypted text&lt;/b&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,3,1,0,1,1,0"&gt;The &lt;b&gt;RSA-encrypted Session Key&lt;/b&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,4,0"&gt;&lt;b&gt;Decrypt the Session Key (Receiver - External Service):&lt;/b&gt;&lt;/p&gt;
&lt;ul data-path-to-node="16,4,1"&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,4,1,0,0"&gt;The external service uses its &lt;b&gt;RSA Private Key&lt;/b&gt; to decrypt the &lt;b&gt;encrypted key&lt;/b&gt;. This recovers the original &lt;b&gt;Session Key&lt;/b&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,5,0"&gt;&lt;b&gt;Decrypt the Data (Receiver - External Service):&lt;/b&gt;&lt;/p&gt;
&lt;ul data-path-to-node="16,5,1"&gt;
&lt;li&gt;
&lt;p data-path-to-node="16,5,1,0,0"&gt;The external service uses the recovered &lt;b&gt;Session Key&lt;/b&gt; to decrypt the &lt;b&gt;AES-encrypted text&lt;/b&gt;, revealing the original message.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-path-to-node="17"&gt;&lt;/p&gt;
&lt;h3&gt;&lt;b&gt;In summary of your original guess:&lt;/b&gt;&lt;/h3&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul data-path-to-node="18"&gt;
&lt;li&gt;
&lt;p data-path-to-node="18,0,0"&gt;You are correct that you should use the external service&amp;#39;s &lt;b&gt;RSA Public Key&lt;/b&gt; for encryption.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="18,1,0"&gt;You are incorrect in assuming this public key will directly encrypt the &lt;i&gt;entire message&lt;/i&gt; in a way that allows the external service to use its &lt;b&gt;Private Key to decrypt the AES-encrypted data&lt;/b&gt;. The RSA Public Key&amp;#39;s job is to secure the &lt;i&gt;Session Key&lt;/i&gt;, not the data itself.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-path-to-node="19"&gt;You&amp;#39;ll need a mechanism within the &amp;quot;Encryption Functions&amp;quot; plugin (or a custom process) that allows you to perform &lt;b&gt;both&lt;/b&gt; the AES encryption of the data AND the RSA encryption of the AES key.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>