Skip to content

TaleTN/libtomcrypt-rsa-howto

Repository files navigation

LIBTOMCRYPT RSA DIGITAL SIGNATURES HOW-TO

This how-to describes how to implement RSA digital signatures using
LibTomCrypt (and LibTomMath) on Windows and macOS.

GETTING STARTED

1. Get LibTomMath and LibTomCrypt

   git clone https://github.com/TaleTN/libtommath.git
   git clone https://github.com/TaleTN/libtomcrypt.git

2. Remove unused source files (optional)

   perl remove_unused.pl --force

3. Build LibTomMath and LibTomCrypt

   [n]make [-f makefile.msvc]

4. Generate public/private key pair

   [n]make [-f makefile.msvc] key

5. Run sign and verify examples

   [n]make [-f makefile.msvc] test

6. Have fun!

FILES IN THIS DISTRIBUTION

dertoh.cpp       - Utility that converts DER to C/C++ header file format, so
                   you can directly include the public key in a C/C++ source
                   file.
dertopem.sh      - Bash script that uses OpenSSL to convert the public and
                   private key pair from DER to PEM file format.
error.h          - Helper routines for rsa_make_key.cpp, rsa_sign.cpp, and
                   rsa_verify.cpp.
LICENSE          - License, duh!
makefile         - GCC/Clang makefile.
makefile.msvc    - Microsoft C/C++ makefile.
README           - <-- You are here.
remove_unused.pl - Perl script that removes all unused LibTomMath and
                   LibTomCrypt files.
rsa_make_key.cpp - Example that generates a public and private key pair.
rsa_sign.cpp     - Example that signs a message.
rsa_verify.cpp   - Example that verifies a signature.

LICENSE

Copyright (C) 2015-2021 Theo Niessink <theo@taletn.com>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the LICENSE file for more details.