CryptoSwift提供多種標準的加密演算法,並支援字串與資料之間的轉換。
支援
- Hash
MD5、SHA1、SHA224、SHA256、SHA384、SHA512、SHA3
- Cyclic Redundancy Check(CRC)
CRC32、CRC32C、CRC16
- Cipher
AES-128、AES-192、AES-256、ChaCha20、Rabbit、Blowfish
- Message authenticators
Poly1305、HMAC(MD5、SHA1、SHA256)、CMAC、CBC-MAC
- Cipher mode of operation
Electronic codebook(ECB)
Cipher-block chaining(CBC)
Propagating Cipher Block Chaining(PCBC)
Cipher feedback(CFB)
Output Feedback(OFB)
Counter Mode(CTR)
Galois/Counter Mode(GCM)
Counter with Cipher Block Chaining-Message Authentication(CCM)
- Password-Based Key Derivation Function
PBKDF1(Password-Based Key Derivation Function1)
PBKDF2(Password-Based Key Derivation Function2)
HKDF(HMAC-based Extract-and-Expand Key Derivation Function)
Scrypt(The scrypt Password-Based Key Derivation Function)
- Data padding
PKCS#5、PKCS#7、zero padding、No padding
- Authenticated Encryption with Associated Data(AEAD)
AEAD_CHACHA20_POLY1305
配製方法
pod 'CryptoSwift'
pod install