Internal Algorithms
A brief guide to the innards of this package.
Internally, PointyCastle is a strongly object-oriented system, drilling down to various different algorithms through a class hierarchy. At the base of this hierarchy, there are a bunch of abstract classes. These classes are below with short explanations and examples. (Keep in mind that the security information is oversimplified and not gospel by any means.)
StreamCipher: a class for symmetric two-way encryption machines known as "stream ciphers" which process data by the bit. Examples are ChaCha20 and Salsa20.
BlockCipher: a class for symmetric two-way encryption machines known as "block ciphers" which process data in "blocks" of varying sizes. Example is AES.
AEADCipher: a class for symmetric two-way encryption machines which are authenticated with a MAC after encryption. These can be based on either StreamCiphers or BlockCiphers.
AssymmetricBlockCipher: a class for asymmetric two-way encryption block ciphers. These use two keys, one public and one private, to encrypt and decrypt. Example is RSA.
Digest: Class for so-called "hashing" algorithms. These take in data and spit out pseudorandom output. It is impossible to know from the output what the input is; that's the security benefit. Examples are Blake2b, SHA-256, and MD5.
KeyDerivator: KeyDerivators are much like Digests with extra inputs & security. They are designed to take a password and convert it into an key. Examples are SCrypt and PBKDF2.
MAC (Messge Authentication Code): A MAC is used to verify the integrity of a message. The MAC of a message is a hash sent with an encrypted message. If sender has an incorrect key, or if the message has been tampered with, the MAC computed sender-side will not match the MAC computed receiver-side. Examples are HMAC, CMAC, and Poly1305.
Signer: A digital signature is to AssymetricBlockCipher what MAC is to BlockCipher. For the sake of brevity, I won't go into detail; read this SO post for more info.
That's it! There is more algorithms than just the ones that fall neatly into these piles, but the vast majority of PointyCastle are subclasses of these classes or helper classes for these classes.
To learn more about each class and the ecosystem surrounding it, click on the links to the left.
Last updated
Was this helpful?