Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I handle keys when trying to use TripleDES to encrypt transactions between GWT client and perl server?
    primarykey
    data
    text
    <p>I have a GWT client talking to a perl server via JSON over HTTP. It works great, but there are some privacy issues and I need to encrypt the transactions. After doing a bit a research it seems as though the easiest/best supported option is to user TripleDES, with gwt-crypto for the client and Crypt:CBC for the server. The problem is I can't figure out how to use the same key for both ends, because how you set them up appears to be completely different. On the java/gwt side I am doing the following:</p> <pre><code>_cipher.setKey(Hex.decode("dc7c62768f0d9d514373d520438ff8f8")); // 16 bytes </code></pre> <p>and on the perl side I am doing:</p> <pre><code>my $cipher = Crypt::CBC-&gt;new( -key =&gt; 'dc7c62768f0d9d514373d520438ff8f8', -cipher =&gt; 'DES_EDE3'); </code></pre> <p>I have tried various key schemes, but it seems if I make gwt happy then perl isn't, and vica versa. For example, as far as I can tell the following perl should work, but I get an "Invalid key" error when I try it:</p> <pre><code>my $iv = Crypt::CBC-&gt;random_bytes(8); my $key = pack("H*", 'dc7c62768f0d9d514373d520438ff8f8'); my $cipher = Crypt::CBC-&gt;new( -key =&gt; $key, -literal_key =&gt; 1, -keysize =&gt; 16, -header =&gt; 'none', -padding =&gt; 'standard', -iv =&gt; $iv, -cipher =&gt; 'DES_EDE3' ); </code></pre> <p>So, I think I could eventually figure out the coding issues, what I am having trouble it jumping through the hoops to tell each side what key to use. Any help is greatly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload