Encryption plugin for Grails crypto

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Encryption plugin for Grails crypto

Herbert Baeuerle
Hi All,

I installed: grails install-plugin crypto without problems

How I use it?  What I am missing?

If I try:

         def message ="Hallo Herbert"
         def password = "fab"
         byte[] encrypted = Blowfish.encrypt(message.getBytes(), password)
         log.debug("Encrypted: ${encrypted}")

         def decrypted = Blowfish.decrypt(encrypted, password)
         log.debug("Decrypted: ${decrypted}")

I get:

groovy.lang.MissingPropertyException: No such property: Blowfish for
class: LoginController
        at LoginController$_closure2.doCall(LoginController.groovy:86)
        at LoginController$_closure2.call(LoginController.groovy)


Thanks for any tips.

Herbert

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Encryption plugin for Grails crypto

bobbywarner
Are you missing an import?
Reply | Threaded
Open this post in threaded view
|

Re: Encryption plugin for Grails crypto

John Moore
Stick this line at the top and you're good to go:

import cr.co.arquetipos.crypto.Blowfish

You'll probably also want to change the last line of your test to

  log.debug("Decrypted: ${new String(decrypted)}")

so you can see the string restored to its former glory.
Reply | Threaded
Open this post in threaded view
|

Re: Encryption plugin for Grails crypto

Herbert Baeuerle
Thanks for the reply,

I found an entry on the web.  I added the import, but I also had to
download the bouny.. jar.
Why do I have to do this?  I thought this is part of the plugin.

Thanks



On Wed, Jun 15, 2011 at 2:10 PM, John Moore <[hidden email]> wrote:

> Stick this line at the top and you're good to go:
>
> import cr.co.arquetipos.crypto.Blowfish
>
> You'll probably also want to change the last line of your test to
>
>  log.debug("Decrypted: ${new String(decrypted)}")
>
> so you can see the string restored to its former glory.
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Encryption-plugin-for-Grails-crypto-tp3599701p3600153.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Encryption plugin for Grails crypto

webmediauk
Where can I download the bouncy castle jar guys?
I'm having exactly the same issue.
I would have thought the plugin would have been all that was needed?
Thanks
Reply | Threaded
Open this post in threaded view
|

Encryption plugin for Grails crypto

webmediauk
Please ignore this comments Netbeans was complaining about the import but the actual app finds bouncy castle and the plugin OK when run.
Cheers