ArticleslgStudy

computer science

Crypto++

Crypto++ is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Crypto++ rather than just read about it. In short: Crypto++ (also known as CryptoPP, libcrypto++, and libcryptopp) is a free and open-source C++ class library of cryptographic algorithms and schemes written by Wei Dai. Crypto++ has been widely used in academia, student projects, open-source, and non-commercial projects, as well as businesses.

Key takeaways

  • Crypto++ belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Crypto++ to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Crypto++ from memory before moving on to harder problems.

Reference excerpt

Crypto++ (also known as CryptoPP, libcrypto++, and libcryptopp) is a free and open-source C++ class library of cryptographic algorithms and schemes written by Wei Dai. Crypto++ has been widely used in academia, student projects, open-source, and non-commercial projects, as well as businesses. Released in 1995, the library fully supports 32-bit and 64-bit architectures for many major operating systems and platforms, including Android (using STLport), Apple (macOS and iOS), BSD, Cygwin, IBM AIX, Linux, MinGW, Solaris, Windows, Windows Phone and Windows RT. The project also supports compilation using C++03, C++11, C++14, and C++17 runtime libraries; and a variety of compilers and IDEs, including Borland Turbo C++, Borland C++ Builder, Clang, CodeWarrior Pro, GCC (including Apple's GCC), Intel C++ Compiler (ICC), Microsoft Visual C/C++, and Sun Studio. Crypto++ 1.0 was released in June 1995, but the download is no longer available. The Crypto++ 1.0 release was withdrawn due to RSA Data Security, Inc asserting its patent over the RSA algorithm. All other versions of the library are available for download.

Algorithms Crypto++ ordinarily provides complete cryptographic implementations and often includes less popular, less frequently-used schemes. For example, Camellia is an ISO/NESSIE/IETF-approved block cipher roughly equivalent to AES, and Whirlpool is an ISO/NESSIE/IETF-approved hash function roughly equivalent to SHA; both are included in the library. Additionally, the Crypto++ library sometimes makes proposed and bleeding-edge algorithms and implementations available for study by the cryptographic community. For example, VMAC, a universal hash-based message authentication code, was added to the library during its submission to the Internet Engineering Task Force (CFRG Working Group); and Brainpool curves, proposed in March 2009 as an Internet Draft in RFC 5639, were added to Crypto++ 5.6.0 in the same month.

The library also makes available primitives for number-theoretic operations such as fast multi-precision integers; prime number generation and verification; finite field arithmetic, including GF(p) and GF(2n); elliptical curves; and polynomial operations. Furthermore, the library retains a collection of insecure or obsolescent algorithms for backward compatibility and historical value: MD2, MD4, MD5, Panama Hash, DES, ARC4, SEAL 3.0, WAKE, WAKE-OFB, DESX (DES-XEX3), RC2, SAFER, 3-WAY, GOST, SHARK, CAST-128, and Square.

Performance In a 2007 ECRYPT workshop paper focusing on public key implementations of eight libraries, Ashraf Abusharekh and Kris Kaj found that "Crypto++ 5.1 [sic] leads in terms of support for cryptographic primitives and schemes, but is the slowest of all investigated libraries." In 2008, speed tests carried out by Timo Bingmann using seven open-source security libraries with 15 block ciphers, Crypto++ 5.5.2 was the top-performing library under two block ciphers and did not rank below the average library performance under the remaining block ciphers. Crypto++ also includes an auto-benchmarking feature, available from the command line (cryptest.exe b), the results of which are available at Crypto++ 5.6.0 Benchmarks. As with many other cryptographic libraries available for 32-bit and 64-bit x86 architectures, Crypto++ includes assembly routines for AES using AES-NI. With AES-NI, AES performance improves dramatically: 128-bit AES-GCM throughput increases from approximately 28.0 cycles per byte to 3.5 cycles per byte.

Version releases Crypto++ 1.0 was released in June 1995. Since its initial release, the library has seen nearly two dozen revisions, including an architectural change in version 5.0. There have been ten releases using the version 5.0 architecture since March 2009.

Lawrence Teo's compilation of previous Crypto++ releases dating back to 1995 can be found in the users group archives.

FIPS validations Crypto++ has received three Federal Information Processing Standard (FIPS) 140-2 Level 1 module validations with no post-validation issues.

Crypto++ was moved to the CMVP's Historical Validation List in 2016. The move effectively means the library is no longer validated.

Licensing As of version 5.6.1, Crypto++ consists of only public domain files, with a compilation copyright and a single open source license for the compilation copyright:

The License of Crypto++ is somewhat unusual amongst open source projects. A distinction is made between the library as a compilation (i.e., collection), which is copyrighted by Wei Dai, and the individual files in it, which are public domain. The library is copyrighted as a compilation in order to place certain disclaimers (regarding warranty, export, and patents) in the license and to keep the attributions and public domain declarations intact when Crypto++ is distributed in source code form. The fact that individual files are public domain means that legally you can place code segments, entire files, or small sets of files (up to the limit set by fair use) into your own project and do anything you want with them without worrying about the copyright.

See also

Computer science Symmetric cipher Comparison of cryptography libraries

References

External links Official website Crypto++ GitHub project List of projects that use Crypto++ (Includes nonprofit and for profit projects) Crypto++ users group

Worked examples

Example 1 — a first encounter with Crypto++

Start with the simplest possible case. Write down what Crypto++ claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Crypto++ before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Crypto++ ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Crypto++

In research
Crypto++ appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Crypto++ in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Crypto++ is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1995 software, C++ libraries, Cryptographic algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Crypto++ outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Crypto++” →

How to study Crypto++ in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Crypto++ means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Crypto++ out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Crypto++ in simple terms?

Crypto++ (also known as CryptoPP, libcrypto++, and libcryptopp) is a free and open-source C++ class library of cryptographic algorithms and schemes written by Wei Dai. Crypto++ has been widely used in academia, student projects, open-source, and non-commercial projects, as well as businesses.

Why does Crypto++ matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Crypto++?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Crypto++.

Tags

  • 1995 software
  • C++ libraries
  • Cryptographic algorithms
  • Cryptographic software
  • Free computer libraries
  • Public-domain software with source code

Keep exploring