chickadee » chibi-crypto

chibi-crypto

Chibi Scheme's crypto library

Module: (chibi crypto md5)

md5

md5 srcprocedure

Returns the md5 checksum of src as a lowercase hex-string. src can be any of a string (interpreted as utf8), a bytevector, or a binary input port.

Module: (chibi crypto sha2)

sha-224

sha-224 srcprocedure

Computes SHA-224 digest of the src which can be a string, a bytevector, or a binary input port. Returns a hexadecimal string (in lowercase).

sha-256

sha-256 srcprocedure

Computes SHA-256 digest of the src which can be a string, a bytevector, or a binary input port. Returns a hexadecimal string (in lowercase).

Module: (chibi crypto rsa)

Please note: this library should not be considered cryptographically secure because:

rsa-key-gen-from-primes

rsa-key-gen-from-primes bit-length p q #!optional exponentprocedure

Generate RSA key pair record with bit-length using primes p, q, and optional exponent.

rsa-key-gen

rsa-key-gen #!optional (bit-length 128)procedure

Generate an RSA key pair record with bit-length, which defaults to 128.

rsa-pub-key

rsa-pub-key priv-keyprocedure

Returns a copy of the given key with the private key, if any,removed.

pkcs1-pad

pkcs1-pad bvprocedure

Undocumented

pkcs1-unpad

pkcs1-unpad bvprocedure

Undocumented

rsa-encrypt

rsa-encrypt pub-key msgprocedure

Encrypts msg for the given public key pub-key. msg may be an integer or bytevector, in which case the result is of the same type, or a string, in which case the string is first coerced to a utf8 encoded bytevector.

rsa-decrypt

rsa-decrypt priv-key cipherprocedure

Decrypts cipher using the given private key priv-key. cipher may be an integer or bytevector, in which case the result is of the same type, or a string, in which case the string is first coerced to a utf8 encoded bytevector.

rsa-sign

rsa-sign priv-key msgprocedure

Signs msg using the given private key priv-key.

rsa-verify

rsa-verify pub-key sigprocedure

Returns the verified (decrypted) message for the signature sig.

rsa-verify?

rsa-verify? pub-key msg sigprocedure

Returns true iff sig is a valid signature of msg for the given public key pub-key.

Maintainer

Diego A. Mundo

Author

Alex Shinn

Version History

0.1.1
Fix egg category
0.1.0
Initial library port

License

BSD

Copyright (c) 2009-2021 Alex Shinn 
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. The name of the author may not be used to endorse or promote products 
   derived from this software without specific prior written permission. 
 
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. 

Contents »