Cryptographic algorithms implemented in Swift.

CryptoSwift is a growing collection of standard and secure cryptographic algorithms implemented in Swift.

Cryptographic algorithms implemented in Swift.

CryptoSwift is a growing collection of standard and secure cryptographic algorithms implemented in Swift.

When it comes to software, all of the operations are handled by crypto frameworks, or libraries. In particular, the Apple platform has CommonCrypto within the system library. There is also OpenSSL. Both of these are C libraries that can be used with Swift through C interoperability. SwiftSSL is a wrapper around OpenSSL that we can use. NaCl only does a fraction of what OpenSSL can do, but is still a very good library.

CryptoSwift is an approach to implement crypto functions in pure Swift, which I will talk about further on. Finally, you can use JavaScript with CryptoJS. Bridging is painful, but it can be used.

Hash

A cryptographic hash function is a mathematical algorithm which is designed to also be a one-way function, that is, a function which is infeasible to invert.

MD5

The MD5 algorithm is intended for digital signature applications, where a large file must be “compressed” in a secure manner before being encrypted with a private (secret) key under a public-key crypto system such as RSA.

SHA1

The Secure Hash Algorithm 1 is called secure because it is computationally infeasible to find a message which corresponds to a given message digest, or to find two different messages which produce the same message digest.

SHA224, SHA256, SHA384, SHA512

The Secure Hash Algorithms; namely SHA-224, SHA-256, SHA-384, and SHA-512; specified in this document are called secure because it is computationally infeasible to (1) find a message that corresponds to a given message digest, or (2) find two different messages that produce the same message digest.

SHA3

The standard specifies the Secure Hash Algorithm-3 family of functions on binary data. Each of the SHA-3 functions is based on an instance of the KECCAK algorithm that NIST selected as the winner of the SHA-3 Cryptographic Hash Algorithm Competition.

Ciphers

A cipher is an algorithm for performing encryption or decryption — a series of well-defined steps that can be followed as a procedure.

AES-128, AES-192, AES0256

The Advanced Encryption Standard algorithmspecifies a FIPS-approved cryptographic algorithm that can be used to protect electronic data. The AES algorithm is a symmetric block cipher that can encrypt (encipher) and decrypt (decipher) information.

ChaCha20

The ChaCha family of stream ciphers, a variant of the Salsa20 family. The Salsa20/20 stream cipher expands a 256-bit key into 264 randomly accessible streams, each containing 264 randomly accessible 64-byte blocks.

Rabbit

The Rabbit Stream Cipher Algorithm is a stream cipher algorithm with a 128-bit key and 64-bit initialization vector (IV). Its high performance makes it particularly suited for the use with Internet protocols where large amounts of data have to be processed.

Blowfish

The Blowfish Encryption Algorithm is a symmetric block cipher that can be used as a drop-in replacement for DES or IDEA. It takes a variable-length key, from 32 bits to 448 bits, making it ideal for both domestic and exportable use. Blowfish was designed in 1993 by Bruce Schneier as a fast, free alternative to existing encryption algorithms.

Cyclic Redundancy Checks

A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data

CRC32

The CRC32 algorithm is a variant of CRC with 33 bits. The CRCTable is a memoization of a calculation that would have to be repeated for each byte of the message.

CSR16

The CRC16 algorithm has nineteen conflicting definitions for 17 bits CRC-16.

Message Authenticators

A Message Authenticator is a way to check the integrity of information transmitted over or stored in an unreliable medium.

Poly1305

The Poly1305-AES algorithm is very close to the security of AES and can be computed at extremely high speed.

HMAC MD5, SHA1, SHA256

The HMAC: Keyed-Hashing for Message Authentication algorithm provides a way to check the integrity of information transmitted over or stored in an unreliable medium is a prime necessity in the world of open computing and communications.

References: https://cryptoswift.io/