Cryptography Tutorials
- Herong's Tutorial Examples
v5.41, 2022
Herong Yang
Copyright 2022 Herong Yang. All rights reserved.
This cryptography tutorial book is a collection of notes and sample codes written by the author while he was learning cryptography technologies himself. Topics include MD5 and SHA1 message digest algorithms and implementations, DES, Blowfish and AES secret key cipher algorithms and implementations, RSA and DSA public key encryption algorithms and implementations, Java and PHP cryptography APIs, OpenSSL, keytool and other cryptography tools, PKI certificates and Web browser supports. Updated in 2022 (Version v5.41) with minor changes. For latest updates and free sample chapters, visit https://www.herongyang.com/Cryptography.
Table of Contents
Keywords: Cryptography, Encryption, Security, Tutorial, Example
About This Book
This section provides some detailed information about this book - Cryptography Tutorials - Herong's Tutorial Examples.
Title: Cryptography Tutorials - Herong's Tutorial Examples
Author: Herong Yang -Contact by email via herong_yang@yahoo.com.
Category: Computers / Security / Cryptography
Version/Edition: v5.41, 2022
Number of pages in PDF format: 445
Description:This cryptography tutorial book is a collection of notes and sample codes written by the author while he was learning cryptography technologies himself. Topics include MD5 and SHA1 message digest algorithms and implementations, DES, Blowfish and AES secret key cipher algorithms and implementations, RSA and DSA public key encryption algorithms and implementations,Java and PHP cryptography APIs, OpenSSL, keytool and other cryptography tools,PKI certificates and Web browser supports.Updated in 2022 (Version v5.41) with minor changes.
Keywords: Cryptography, Encryption, Security, Tutorial, Example
Copyright:
- This book is under Copyright 2022 Herong Yang. All rights reserved.
- Material in this book may not be published, broadcasted, rewritten or redistributed in any form.
- The example codes is provided as-is, with no warranty of any kind.
Revision history:
- Version 5.41, 2022. Minor updates.
- Version 5.30, 2015. Added tutorials on AES algorithms.
- Version 5.20, 2013. Added tutorials on RSA and DSA algorithms.
- Version 5.00, 2009. Added tutorials on MD5 and SHA1 algorithms.
- Version 4.00, 2007. Added tutorials on OpenSSL.
- Version 3.00, 2004. Added tutorials on Java keytool.
- Version 2.00, 2003. Added tutorials on Blowfish algorithm.
- Version 1.00, 2002. Started with tutorials on DES algorithm.
Web version: https://www.herongyang.com/Cryptography -Provides free sample chapters, latest updates and readers' comments.The Web version of this book has been viewed a total of:
- 4,547,249 times as of December 2021.
- 4,285,143 times as of December 2020.
- 4,041,411 times as of December 2019.
- 3,789,402 times as of December 2018.
- 3,562,281 times as of December 2017.
- 3,270,508 times as of December 2016.
- 2,668,481 times as of December 2015.
- 1,974,178 times as of December 2014.
- 1,476,164 times as of December 2013.
- 1,191,405 times as of December 2012.
- 936,329 times as of December 2011.
- 687,681 times as of December 2010.
- 417,742 times as of December 2009.
- 237,675 times as of December 2008.
- 190,670 times as of December 2007.
PDF/EPUB version: https://www.herongyang.com/Cryptography/PDF-Full-Version.html -Provides information on how to obtain the full version of this book in PDF, EPUB, or other format.
Cryptography Terminology
This section provides descriptions on some commonly used cryptography terminologies
AES (Advanced Encryption Standard): A data encryption standard adopted in 2001 by the US government to replace DES (Advanced Encryption Standard).AES uses Rijndael ciphers developed by Joan Daemen and Vincent Rijmen.AES ciphers are symmetric 128-bit block encryptions with 128-bit, 196-bit and 256-bit keys.AES ciphers are more secure and faster than DES ciphers.
Blowfish: A Feistel network iterating a simple encryption function 16 times. The block size is 64 bits, and the key can be any length up to 448 bits. Although there is a complex initialization phase required before any encryption can take place, the actual encryption of data is very efficient on large microprocessors.
CBC (Cipher Block Chaining): An operation mode for block ciphers, where each plaintext block is XORed with the previous ciphertext block before encryption.
Certification Chain: Also called Certificate Path. An ordered list of certificates where the subject entity of one certificate is identical to the issuing entity of the next certificate.
Certificate Path: Also called Certification Chain. An ordered list of certificates where the subject entity of one certificate is identical to the issuing entity of the next certificate.
CFB (Cipher FeedBack): An operation mode for block ciphers, where each block of plaintext is XORed with the encrypted version of the previous ciphertext to generate the current ciphertext block.
DES (Data Encryption Standard): A 16-round Feistel cipher with block size of 64 bits.DES was developed by IBM in 1974 in response to a federal government publicinvitation for data encryption algorithms. In 977, DES was published as a federal standard, FIPS PUB 46.
ECB (Electronic CodeBook): An operation mode for block ciphers, where each plaintext block is encryptedindependent from other blocks.
MD5 (Message Digest 5): A message-digest algorithm, which takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input. It is conjectured that it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given pre-specified target message digest.
OFB (Output FeedBack): An operation mode for block ciphers, where each block of plaintext is XORed with the encrypted version of the previous ciphertext to generate the current ciphertext block.
OpenSSL: A cryptography toolkit implementing the Secure Sockets Layer(SSL v2/v3) and Transport Layer Security (TLS v1) network protocols andrelated cryptography standards required by them.
PKCS5Padding: A padding schema for block ciphers, where the number of padded bytes equals to "8 - numberOfBytes(clearTextMessage) mod 8", and the value of each padded byte is an integer value of the number of padded bytes.
RSA (Ronald L. Rivest, Adi Shamir, and Leonard M. Adleman): A public key algorithm invented in 1976 by three MIT mathematicians, Ronald L. Rivest, Adi Shamir, and Leonard M. Adleman.
SHA1 (Secure Hash Algorithm 1): A message-digest algorithm, which takes an input message of any length < 2^64 bits and produces a 160-bit outputas the message digest.
Cryptography Basic Concepts
This chapter describes some basic concepts of cryptography: what is cryptography, what is function and what is encryption.
What Is Cryptography?
This section describes what is cryptography - The study of techniques related to all aspects of data security.
Cryptography - The study of techniques related to all aspects of data security. The word "cryptography" is derived from the ancient Greek words "kryptos" (hidden) and "graphia" (writing).
Next page