Posts

Showing posts with the label Xcode

[How To] Run HELR (Homomorphic Encryption Logistic Regression) in macOS

Image
HELR is a software project for performing a logistic regression training on encrypted data (Secure Logistic Regression based on Homomorphic Encryption: Design and Evaluation ( https://medinform.jmir.org/2018/2/e19/ )). Step 1: brew install GMP Step 2: brew install NTL Step 3: git clone  https://github.com/K-miran/HELR.git Step 4: cd HELR

[Solved] 15 duplicate symbols for architecture x86_64

Image
Error: If you are getting build failures in Xcode for a C++ program with similar errors, then try this fix. 15 duplicate symbols for architecture x86_64 ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Solution: You can avoid declaring variables in the header and move them to implementation. Or you can declare all the variables in the header file as static.

[How To] Use Cryptopp in Kali Linux

Image
 Crypto++ is a popular C++ library for cryptography. Instruction in this article can be used to install Cryptopp for all operating systems similar to Kali Linux. Check out this article if you want to use it with Xcode in macOS. Step 1: Download Crypto++ using this link Step 2: Extract Crypto++ and switch to that directory from the terminal or shell. Step 3: $ make Step 4: $ make test Step 5: $ sudo make install Step 6: Compile your program using g++ -I/usr/local/include -L/usr/local/lib yourCode.cpp -lcryptopp

[Solved] 'cryptopp/aes.h' file not found; Expected namespace name

Image
If you are facing errors like " 'cryptopp/aes.h' file not found " or getting "Expected namespace name" error for " using namespace CryptoPP; " or similar compilation errors, refer to the following settings: Add "/usr/local/include" in Header search paths Add "/usr/local/lib" in Library search paths Add -lcryptopp as a Linker flag Refer to this article for more information:  https://com.puter.tips/2021/02/how-to-use-cryptopp-in-xcode.html These C++ build errors mean the compiler cannot find the Crypto++ headers or library, so the CryptoPP namespace looks undefined. The include and library search paths are not set. Adding /usr/local/include to the header search paths and the matching library path to the linker settings points the build at Crypto++ and clears both errors at once.

[How To] Use Boost in Xcode

Image
Using Boost C++ Libraries ( https://www.boost.org/ ) is relatively easier than setting up Cryptopp. [Ref.:  https://com.puter.tips/2021/02/how-to-use-cryptopp-in-xcode.html ] Step-1: Install boost libraries $ brew install boost Step-2: Link boost in Build Settings Navigate to Linking >> Other Linker Flags Add following flags as per your requirement -lboost_chrono -lboost_system -lboost_timer -lboost_regex This guide sets up the Boost C++ libraries in an Xcode project, which is simpler than wiring up some other libraries. After installing Boost with Homebrew, you add the linker flags so the project finds it. Boost is a large, widely used collection of peer reviewed C++ libraries, many of which later influenced the standard library. Getting the link settings right once lets you use any of them.

[Solved] code signature not valid for use in process using Library Validation

Image
So I was working on a C++ project on Xcode, and I updated to the latest version of Xcode with recommended default settings; then I started having the following errors: dyld: Library not loaded: /usr/local/lib/libcryptopp.dylib    Referenced from: /Users/devharsh/Library/Developer/Xcode/DerivedData/server-bohvcuztzndrrzhcoglrvuijfasj/Build/Products/Debug/server    Reason: no suitable image found.    Did find: /usr/local/lib/libcryptopp.dylib: code signature in (/usr/local/lib/libcryptopp.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed. /usr/local/lib/libcryptopp.dylib: code signature in (/usr/local/lib/libcryptopp.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed. /usr/local/lib/libcryptopp.dylib: code signature in (/usr/local/lib/libcryptopp.dylib) not vali...

[How To] Use Cryptopp in Xcode

Image
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 operati...

Microsoft SEAL installation on macOS

Image
Microsoft SEAL is an easy-to-use open-source (MIT licensed) homomorphic encryption library developed by the Cryptography and Privacy Research Group at Microsoft. Microsoft SEAL is written in modern standard C++ and is easy to compile and run in many different environments. For more information about the Microsoft SEAL project, see sealcrypto.org . brew install cmake autoconf automake libtool shtool gflags xcode-select --install git clone https://github.com/google/googletest cd googletest-master cmake . make make install git clone https://github.com/microsoft/SEAL cd SEAL