I think every second person I spoke to at roro syd on tuesday asked me if I
could demo the encryption code in Haskell (did i just hang out in the wrong
corner of the room or something?). Here's my feeble attempts at learning
Haskell:

import Data.Char
import Data.Bits
import Numeric

{- Modular Exponentiation: b^e mod m -}
modExp2 b e m r
  | e == 0       = r
  | e .&. 1 == 1 = modExp2 (b*b `mod` m) (e `div` 2) m (r*b `mod` m)
  | otherwise    = modExp2 (b*b `mod` m) (e `div` 2) m r
modExp b e m = modExp2 b e m 1

{- The RSA algorithms are actually quite simple as you can see -}
encrypt = modExp message exponent publicKey
decrypt = modExp encrypted privateKey publicKey

There's a slightly more readable version on github:
http://github.com/chrishulbert/crypto/blob/master/haskell/rsa.hs

On Wed, Jul 14, 2010 at 12:00 PM, Mark Wotton <[email protected]> wrote:

> I'm glad you asked - YHC can compile Haskell down to javascript, so
> you guys who hate GWT can bitch about this too:
>
> http://www.haskell.org/haskellwiki/Haskell_in_web_browser
>
> mark
>
> On Wed, Jul 14, 2010 at 11:20 AM, Andrew Grimm <[email protected]>
> wrote:
> > Yeah - what does haskell have to do with javascript?
> >
> > Andrew
> >
> > On Wed, Jul 14, 2010 at 10:38 AM, Luke Chadwick
> > <[email protected]> wrote:
> >> I think you're lost ;)
> >> - Luke
> >>
> >> On 14 July 2010 09:38, Mark Wotton <[email protected]> wrote:
> >>>
> >>> Starting this friday and continuing on to the weekend, there'll be a
> >>> Haskell hackathon at UNSW, as anyone who witnessed my feeble attempts
> >>> at advocacy last night should know. More details:
> >>>
> >>>  http://www.haskell.org/haskellwiki/AusHac2010
> >>>
> >>> Come along, learn some Haskell, make fun of our monads, it'll all be
> good.
> >>>
> >>> mark
> >>>
> >>> --
> >>> A UNIX signature isn't a return address, it's the ASCII equivalent of a
> >>> black velvet clown painting. It's a rectangle of carets surrounding a
> >>> quote from a literary giant of weeniedom like Heinlein or Dr. Who.
> >>>         -- Chris Maeda
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google
> Groups
> >>> "Ruby or Rails Oceania" group.
> >>> To post to this group, send email to [email protected].
> >>> To unsubscribe from this group, send email to
> >>> [email protected]<rails-oceania%[email protected]>
> .
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/rails-oceania?hl=en.
> >>>
> >>
> >>
> >>
> >> --
> >> email: [email protected]
> >> phone: +61402203606
> >> twitter: @vertis
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Ruby or Rails Oceania" group.
> >> To post to this group, send email to [email protected].
> >> To unsubscribe from this group, send email to
> >> [email protected]<rails-oceania%[email protected]>
> .
> >> For more options, visit this group at
> >> http://groups.google.com/group/rails-oceania?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> [email protected]<rails-oceania%[email protected]>
> .
> > For more options, visit this group at
> http://groups.google.com/group/rails-oceania?hl=en.
> >
> >
>
>
>
> --
> A UNIX signature isn't a return address, it's the ASCII equivalent of a
> black velvet clown painting. It's a rectangle of carets surrounding a
> quote from a literary giant of weeniedom like Heinlein or Dr. Who.
>         -- Chris Maeda
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rails-oceania%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rails-oceania?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to