Crypto-4.2.5.2: Common Cryptographic Algorithms in Pure Haskell
Copyright(c) David J. Sankel 2003 Dominic Steinitz 2003
LicenseGPL (see the file ReadMe.tex)
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Codec.Encryption.RSA

Description

A modified version of the RSA module supplied by David J. Sankel (http://www.electronconsulting.com/rsa-haskell).

As the original code is GPL, this has to be. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this code; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Synopsis

Function Types

encrypt :: ([Octet], [Octet]) -> [Octet] -> [Octet] Source #

Take the modulus of the RSA key and the public exponent expressed as lists of octets and the plaintext also expressed as a list of octets and return the ciphertext as a list of octets. Of course, these are all large integers but using lists of octets makes everything easier. See http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/index.html for more details.

decrypt :: ([Octet], [Octet]) -> [Octet] -> [Octet] Source #

Take the modulus of the RSA key and the private exponent expressed as lists of octets and the ciphertext also expressed as a list of octets and return the plaintext as a list of octets.