You are looking at historical revision 45071 of this page. It may differ significantly from its current revision.

chibi-crypto

Chibi Scheme's crypto library

Module: (chibi crypto md5)

[procedure] (md5 src)

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)

[procedure] (sha-224 src)

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).

[procedure] (sha-256 src)

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:

[procedure] (rsa-key-gen-from-primes bit-length p q #!optional exponent)

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

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

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

[procedure] (rsa-pub-key priv-key)

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

[procedure] (pkcs1-pad bv)

Undocumented

[procedure] (pkcs1-unpad bv)

Undocumented

[procedure] (rsa-encrypt pub-key msg)

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.

[procedure] (rsa-decrypt priv-key cipher)

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.

[procedure] (rsa-sign priv-key msg)

Signs msg using the given private key priv-key.

[procedure] (rsa-verify pub-key sig)

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

[procedure] (rsa-verify? pub-key msg sig)

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.