Skip to content
Dan Moore edited this page Mar 12, 2015 · 1 revision

#summary Code examples and maven info

= Code =

This code below assumes a constant key. Note that this is not very secure. Consider using TripleDesKeyGenerator in a more sophisticated fashion.

{{{ TripleDesCipher cipher = new TripleDesCipher(); cipher.setKey(GWT_DES_KEY); try { enc = cipher.encrypt(String.valueOf(value)); } catch (DataLengthException e1) { e1.printStackTrace(); } catch (IllegalStateException e1) { e1.printStackTrace(); } catch (InvalidCipherTextException e1) { e1.printStackTrace(); } }}}

On the client, make sure you inherit the module: <inherits name='com.googlecode.gwt.crypto.Crypto'/> Then:

{{{ TripleDesCipher cipher = new TripleDesCipher(); cipher.setKey(GWT_DES_KEY); String dec =""; try { dec = cipher.decrypt(enc); } catch (DataLengthException e) { e.printStackTrace(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (InvalidCipherTextException e) { e.printStackTrace(); } }}}

= Install =

Declare the module {{{ }}}

== Maven ==

===Starting with gwt-crypto 2.3.0=== {{{ com.googlecode.gwt-crypto gwt-crypto 2.3.0 }}}

===Before gwt-crypto 2.3.0=== First add the repo to your repo list: {{{ gwt-crypto repo http://gwt-crypto.googlecode.com/svn/trunk/repo/ }}}

Then add the dependency: {{{ com.googlecode.gwt.crypto gwt-crypto 1.0.2 }}}

==non-Maven Usage==

Non-Maven users can download the jar from the download tab and deploy it in whatever format you have defined.

Clone this wiki locally