cryptocipher-0.6.2/0000755000000000000000000000000012232342350012414 5ustar0000000000000000cryptocipher-0.6.2/LICENSE0000644000000000000000000000273112232342350013424 0ustar0000000000000000Copyright (c) 2010-2013 Vincent Hanquez All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the author nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cryptocipher-0.6.2/cryptocipher.cabal0000644000000000000000000000211712232342350016114 0ustar0000000000000000Name: cryptocipher Version: 0.6.2 Description: Symmetrical block and stream ciphers. License: BSD3 License-file: LICENSE Copyright: Vincent Hanquez Author: Vincent Hanquez Maintainer: Vincent Hanquez Synopsis: Symmetrical block and stream ciphers. Category: Cryptography Build-Type: Simple Homepage: http://github.com/vincenthz/hs-crypto-cipher Cabal-Version: >=1.8 Library Build-Depends: base >= 4 && < 5 , crypto-cipher-types >= 0.0.8 && < 0.1 , cipher-aes >= 0.2.3 && < 0.3 , cipher-rc4 >= 0.1.3 && < 0.2 , cipher-des >= 0.0 && < 0.1 , cipher-blowfish >= 0.0 && < 0.1 , cipher-camellia >= 0.0 && < 0.1 Exposed-modules: Crypto.Cipher ghc-options: -Wall source-repository head type: git location: git://github.com/vincenthz/hs-crypto-cipher subdir: cryptocipher cryptocipher-0.6.2/Setup.hs0000644000000000000000000000005612232342350014051 0ustar0000000000000000import Distribution.Simple main = defaultMain cryptocipher-0.6.2/Crypto/0000755000000000000000000000000012232342350013674 5ustar0000000000000000cryptocipher-0.6.2/Crypto/Cipher.hs0000644000000000000000000000300412232342350015437 0ustar0000000000000000-- | -- Module : Crypto.Cipher -- License : BSD-style -- Maintainer : Vincent Hanquez -- Stability : stable -- Portability : good -- -- All the cipher functionalities are available through the -- BlockCipher and StreamCipher classes. -- -- A simplified example (with simplified error handling): -- -- > import Crypto.Cipher -- > import Data.ByteString (ByteString) -- > import qualified Data.ByteString as B -- > -- > initAES256 :: ByteString -> AES256 -- > initAES256 = either (error . show) cipherInit . makeKey -- > -- > cbcEncryption :: AES256 -> ByteString -> ByteString -> ByteString -- > cbcEncryption ctx ivRaw plainText = cbcEncrypt ctx iv plainText -- > where iv = maybe (error "invalid IV") id $ ivRaw -- module Crypto.Cipher ( -- * Cipher classes Cipher(..) , BlockCipher(..) , StreamCipher(..) -- * Key , Key , makeKey -- * Initialization Vector (IV) , IV , makeIV , nullIV , ivAdd -- * Authenticated Encryption with Associated Data (AEAD) , AEAD , aeadAppendHeader , aeadEncrypt , aeadDecrypt , aeadFinalize -- * Cipher implementations , AES128, AES192, AES256 , Blowfish, Blowfish64, Blowfish128, Blowfish256, Blowfish448 , DES , DES_EEE3, DES_EDE3, DES_EEE2, DES_EDE2 , Camellia128 ) where import Crypto.Cipher.Types import Crypto.Cipher.AES (AES128, AES192, AES256) import Crypto.Cipher.Blowfish import Crypto.Cipher.DES import Crypto.Cipher.TripleDES import Crypto.Cipher.Camellia