Sunday, February 21, 2021

[How To] Use Cryptopp in Xcode

  • Crypto++ Library is a free C++ class library of cryptographic schemes. Currently the library contains the following algorithms: algorithm type name authenticated encryption schemes GCM, CCM, EAX, ChaCha20Poly1305 and XChaCha20Poly1305 high speed stream ciphers ChaCha (8/12/20), ChaCha (IETF), Panama, Salsa20, Sosemanuk, XSalsa20, XChaCha20 AES and AES candidates AES (Rijndael), RC6, MARS, Twofish, Serpent, CAST-256 ARIA, Blowfish, Camellia, CHAM, HIGHT, IDEA, Kalyna (128/256/512), LEA, SEED, RC5, SHACAL-2, other block ciphers SIMON (64/128), Skipjack, SPECK (64/128), Simeck, SM4, Threefish (256/512/1024), Triple-DES (DES-EDE2 and DES-EDE3), TEA, XTEA block cipher modes of operation ECB, CBC, CBC ciphertext stealing (CTS), CFB, OFB, counter mode (CTR), XTS message authentication codes BLAKE2s, BLAKE2b, CMAC, CBC-MAC, DMAC, GMAC, HMAC, Poly1305, Poly1305 (IETF), SipHash, Two-Track-MAC, VMAC BLAKE2s, BLAKE2b, Keccack (F1600), SHA-1, hash functions SHA-2 (224/256/384/512), SHA-3 (224/256/384/512), SHAKE (128/256), SipHash, SM3, Tiger, RIPEMD (128/160/256/320), WHIRLPOOL RSA, DSA, Deterministic DSA, ElGamal, public-key cryptography Nyberg-Rueppel (NR), Rabin-Williams (RW), LUC, LUCELG, EC-based German Digital Signature (ECGDSA), DLIES (variants of DHAES), ESIGN padding schemes for public-key PKCS#1 v2.0, OAEP, PSS, PSSR, IEEE P1363 systems EMSA2 and EMSA5 Diffie-Hellman (DH), Unified Diffie-Hellman (DH2), key agreement schemes Menezes-Qu-Vanstone (MQV), Hashed MQV (HMQV), Fully Hashed MQV (FHMQV), LUCDIF, XTR-DH elliptic curve cryptography ECDSA, Deterministic ECDSA, ed25519, ECNR, ECIES, ECDH, ECMQV, x25519 insecure or obsolescent MD2, MD4, MD5, Panama Hash, DES, ARC4, SEAL algorithms retained for backwards 3.0, WAKE-OFB, DESX (DES-XEX3), RC2, compatibility and historical SAFER, 3-WAY, GOST, SHARK, CAST-128, Square value
  • Xcode is Apple’s integrated development environment (IDE). You use Xcode to build apps for Apple products, including iPad, iPhone, Apple Watch, Apple TV, and Mac. Xcode provides tools to manage your entire development workflow—from creating your app to testing, optimizing, and submitting it to the App Store.

Step 1: Download Crypto++ from https://cryptopp.com/#download

Step 2: Unzip crypto840.zip and cd to that directory

Step 3: $ make -j 4

Step 4: $ sudo make install

Step 5: check the install location from previous step, it should be /usr/local/include/cryptopp for header files and /usr/local/lib for libcryptopp.a file


Step 6: Open Xcode and go to properties and search for "Header Search Paths", set /usr/local/include (non-recursive) as the value

Step 7: search for "Library Search Paths" and set it to /usr/local/lib (non-recursive)

Step 8: search for "Other Linker Flags" and set it to -lcryptopp


Similarly you can compile from command line interface using this
g++ -I/usr/local/include -L/usr/local/lib yourCode.cpp -lcryptopp

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.