Welcome to botan
Hackage: botan-bindings Hackage: botan-low Hackage: botan Build Haddocks
botan is a set of Haskell bindings for the
Botan cryptography library.
Botan's goal is to be the best option for cryptography in C++ by offering the tools necessary to implement a range of practical systems, such as TLS protocol, X.509 certificates, modern AEAD ciphers, PKCS#11 and TPM hardware support, password hashing, and post quantum crypto schemes.
Acknowledgements
This project has received support from the Haskell Foundation, and was made possible through funding provided by Mercury.
Navigation
Introduction
This project has the goal of providing a set of safe and performant bindings to the Botan C++ cryptography library via its C FFI (Foreign Function Interface). It does this by providing 3 libraries at varying levels of complexity and abstraction:
botan-bindingscontains raw bindings with buffers and pointers, and is otherwise an almost a 1:1 translation of the C FFI into Haskellbotan-lowcontains low-level bindings with imperative IO and exceptions, and safely wraps buffers and pointers into bytestrings and autoreleased objectsbotancontains high-level bindings with strong types and idiomatic Haskell, and provides algebraic data types and convenience functions
We suggest using the highest-level library possible, unless you wish to
build your own abstraction over the Botan C++ library. The highest-level
stable library is currently: botan-low
Installation
This library requires Botan 3 to be installed in order to work. See Building the Library in the handbook for more details.
Unix package
~~Botan is available already in nearly all packaging systems so you can probably install it through your distribution / system package manager.~~
At current, Botan 2 is readily available, but Botan 3 is not yet available as a prebuilt linux package. Please see 'Building from source'.
MacOS package
Botan is available through the Homebrew package manager:
From source
Botan can be built from source, for additional configuration options and customization.
Windows from source
Prebuilt botan is not available for windows, and it must be built from source. The process is similar to building from source in Unix or MacOS.
Usage
You will need to add botan as a package dependency in order to use it.
After you have added botan as a dependency, you can begin importing
modules and using them in your code.
import Botan.Low.Hash
main = do
hash <- hashInit "SHA-256"
digest <- hashUpdateFinalize hash "Fee fi fo fum!"
print digestTutorials
Resources
There are several resources for this project that might be helpful:
- Devlog for project status and updates.
- GitHub for Haskell source code, issues, and pull requests.
- Proposal Haskell Foundation funding proposal submission thread.
As well, there are resources for the original Botan C++ library:
- Botan Crypto and TLS for Modern C++
- Botan C++ Github for original Botan C++ source code, issues, and pull requests.
- Botan Handbook for documentation on the original library
- Botan FFI for documentation on the Botan C FFI
- Issue FFI APIs for X.509 are insufficient
License
This project is licensed under the BSD 3-Clause License and is free, open-source software.
Contributing
There are several ways to contribute to the development of this project, and we are happy to receive any bug reports, fixes, documentation, and any other improvements to this project.
Reporting Bugs
See a bug?
- Describe the issue
- Write down the steps required to reproduce the issue
- Report the issue by opening a ticket!
Assist in Development
Want to help?
- Fork or clone the repo, and create a new branch:
git checkout https://github.com/haskellfoundation/botan -b some_new_branch
- Make your changes, and test them
- Submit a pull request with a comprehensive description of the changes
Donations
This is free, open-source software. If you'd like to support the continued development of this project and future projects like this, or just to say thanks, you can donate directly using the following link(s):
Packages
botan-0.1.0.0
- Botan
- Botan.Bcrypt Bcrypt password hashing
- Botan.BlockCipher Raw Block Cipher (PRP) interface
- Botan.BlockCipher.AES
- Botan.BlockCipher.ARIA
- Botan.BlockCipher.Blowfish
- Botan.BlockCipher.CAST
- Botan.BlockCipher.Camellia
- Botan.BlockCipher.Class
- Botan.BlockCipher.DES
- Botan.BlockCipher.GOST
- Botan.BlockCipher.IDEA
- Botan.BlockCipher.Noekeon
- Botan.BlockCipher.SEED
- Botan.BlockCipher.SHALCAL
- Botan.BlockCipher.SM4
- Botan.BlockCipher.Serpent
- Botan.BlockCipher.Threefish
- Botan.BlockCipher.Twofish
- Checksum
- Botan.Cipher Symmetric cipher modes
- Botan.Easy
- Botan.Error
- Botan.HOTP
- Botan.Hash Hash Functions and Checksums
- Botan.KDF
- Botan.KeySpec
- Botan.KeyWrap
- Botan.MAC Message Authentication Codes (MAC)
- OneTimeAuth
- Botan.Padding
- Botan.PubKey Public key cryptography
- Botan.PubKey.Decrypt Public Key Decryption
- Botan.PubKey.Encrypt Public Key Encryption
- Botan.PubKey.KeyAgreement
- Botan.PubKey.KeyEncapsulation Key Encapsulation
- Botan.PubKey.Load Algorithm specific public key operations
- Botan.PubKey.Sign Signature Generation
- Botan.PubKey.Verify Signature Verification
- Botan.PwdHash
- Botan.RNG Random number generators
- Botan.SRP6 Secure remote password
- Types
- Botan.Utility
- Botan.Version
- Botan.X509
- Botan.ZFEC
botan-bindings-0.1.0.0
- Botan
- Bindings
- Botan.Bindings.Bcrypt Bcrypt password hashing
- Botan.Bindings.BlockCipher Raw Block Cipher (PRP) interface
- Botan.Bindings.Cipher Symmetric cipher modes
- Botan.Bindings.Error Error codes and exception handling
- Botan.Bindings.FPE Format Preserving Encryption
- Botan.Bindings.HOTP Hash-based one-time passwords
- Botan.Bindings.Hash Hash Functions and Checksums
- Botan.Bindings.KDF Key Derivation Functions (KDF)
- Botan.Bindings.KeyWrap Bcrypt password hashing
- Botan.Bindings.MAC Message Authentication Codes (MAC)
- Botan.Bindings.MPI Multiple Precision Integers
- Botan.Bindings.Prelude
- Botan.Bindings.PubKey Public key cryptography
- Botan.Bindings.PubKey.DH Algorithm specific key operations: Diffie Hellman
- Botan.Bindings.PubKey.DSA Algorithm specific key operations: DSA
- Botan.Bindings.PubKey.Decrypt Public Key Decryption
- Botan.Bindings.PubKey.ECDH Algorithm specific key operations: ECDH
- Botan.Bindings.PubKey.ECDSA Algorithm specific key operations: ECDSA
- Botan.Bindings.PubKey.Ed25519 Algorithm specific key operations: Ed25519
- Botan.Bindings.PubKey.ElGamal Algorithm specific key operations: ElGamal
- Botan.Bindings.PubKey.Encrypt Public Key Encryption
- Botan.Bindings.PubKey.KeyAgreement Key Agreement
- Botan.Bindings.PubKey.KeyEncapsulation Key Encapsulation
- Botan.Bindings.PubKey.RSA Algorithm specific key operations: RSA
- Botan.Bindings.PubKey.SM2 Algorithm specific key operations: SM2
- Botan.Bindings.PubKey.Sign Signature Generation
- Botan.Bindings.PubKey.Verify Signature Verification
- Botan.Bindings.PubKey.X25519 Algorithm specific key operations: X25519
- Botan.Bindings.PwdHash Password hashing
- Botan.Bindings.RNG Random number generators
- Botan.Bindings.SRP6 Secure remote password
- Botan.Bindings.TOTP Time-based one time passwords
- Botan.Bindings.Utility Utility functions
- Botan.Bindings.Version Botan version info
- Botan.Bindings.View View functions
- Botan.Bindings.X509 X.509 Certificates and CRLs
- Botan.Bindings.ZFEC ZFEC Forward Error Correction
- Bindings
botan-low-0.0.2.0
- Botan
- Low
- Botan.Low.Bcrypt Bcrypt password hashing
- Botan.Low.BlockCipher Raw Block Cipher (PRP) interface
- Botan.Low.Cipher Symmetric cipher modes
- Botan.Low.Error Error codes and exception handling
- Botan.Low.FPE Format Preserving Encryption
- Botan.Low.HOTP Hash-based one-time passwords
- Botan.Low.Hash Hash Functions and Checksums
- Botan.Low.KDF Key Derivation Functions (KDF)
- Botan.Low.KeyWrap Bcrypt password hashing
- Botan.Low.MAC Message Authentication Codes (MAC)
- Botan.Low.MPI Multiple Precision Integers
- Botan.Low.PubKey Public key cryptography
- Botan.Low.PubKey.DH Algorithm specific key operations: Diffie Hellman
- Botan.Low.PubKey.DSA Algorithm specific key operations: DSA
- Botan.Low.PubKey.Decrypt Public Key Decryption
- Botan.Low.PubKey.ECDH
- Botan.Low.PubKey.ECDSA
- Botan.Low.PubKey.Ed25519 Algorithm specific key operations: Ed25519
- Botan.Low.PubKey.ElGamal Algorithm specific key operations: ElGamal
- Botan.Low.PubKey.Encrypt Public Key Encryption
- Botan.Low.PubKey.KeyAgreement Key Agreement
- Botan.Low.PubKey.KeyEncapsulation Key Encapsulation
- Botan.Low.PubKey.RSA Algorithm specific key operations: RSA
- Botan.Low.PubKey.SM2
- Botan.Low.PubKey.Sign Signature Generation
- Botan.Low.PubKey.Verify Signature Verification
- Botan.Low.PubKey.X25519 Algorithm specific key operations: X25519
- Botan.Low.PwdHash Password hashing
- Botan.Low.RNG Random number generators
- Botan.Low.SRP6 Secure remote password
- Botan.Low.TOTP Time-based one time passwords
- Botan.Low.Utility Utility functions
- Botan.Low.Version Botan version info
- Botan.Low.View View functions
- Botan.Low.X509 X.509 Certificates and CRLs
- Botan.Low.ZFEC ZFEC Forward Error Correction
- Low