Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
[[toc:]] == chibi-crypto Chibi Scheme's crypto library === Module: (chibi crypto md5) ==== {{md5}} <procedure>(md5 src)</procedure> 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}} <procedure>(sha-224 src)</procedure> 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}} <procedure>(sha-256 src)</procedure> 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: * The default random primes are chosen using CHICKEN's pseudo-random generator, not system random bytes (this could be changed). * For real-world cryptographical applications, in general you should choose a more well-established and trusted library. ==== {{rsa-key-gen-from-primes}} <procedure>(rsa-key-gen-from-primes bit-length p q #!optional exponent)</procedure> Generate RSA key pair record with {{bit-length}} using primes {{p}}, {{q}}, and optional {{exponent}}. ==== {{rsa-key-gen}} <procedure>(rsa-key-gen #!optional (bit-length 128))</procedure> Generate an RSA key pair record with {{bit-length}}, which defaults to 128. ==== {{rsa-pub-key}} <procedure>(rsa-pub-key priv-key)</procedure> Returns a copy of the given key with the private key, if any,removed. ==== {{pkcs1-pad}} <procedure>(pkcs1-pad bv)</procedure> Undocumented ==== {{pkcs1-unpad}} <procedure>(pkcs1-unpad bv)</procedure> Undocumented ==== {{rsa-encrypt}} <procedure>(rsa-encrypt pub-key msg)</procedure> 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}} <procedure>(rsa-decrypt priv-key cipher)</procedure> 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}} <procedure>(rsa-sign priv-key msg)</procedure> Signs {{msg}} using the given private key {{priv-key}}. ==== {{rsa-verify}} <procedure>(rsa-verify pub-key sig)</procedure> Returns the verified (decrypted) message for the signature {{sig}}. ==== {{rsa-verify?}} <procedure>(rsa-verify? pub-key msg sig)</procedure> 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.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 2 by 3?