All Projects β†’ Huelse β†’ Seal Python

Huelse / Seal Python

Licence: mit
Microsoft SEAL 3.X For Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Seal Python

Open Crypto
πŸ”‘ Hashing (BCrypt, SHA2, HMAC), encryption (AES), public-key (RSA), and random data generation.
Stars: ✭ 115 (-14.18%)
Mutual labels:  encryption
Databunker
Secure storage for personal records built to comply with GDPR
Stars: ✭ 122 (-8.96%)
Mutual labels:  encryption
Demo Twilio Backend Nodejs
A sample backend that demonstrates how to generate a Virgil JWT and Twilio token used for authentication with the Virgil and Twilio services
Stars: ✭ 128 (-4.48%)
Mutual labels:  encryption
Modphuserex
A .NET protector supporting .NET Core forked from the discontinued ConfuserEx
Stars: ✭ 116 (-13.43%)
Mutual labels:  encryption
Comrad
A socialist network: encrypted, insurveillable, unmontizeable, and self-governing. App is written in Python. (Calling all socialist programmers for help!)
Stars: ✭ 122 (-8.96%)
Mutual labels:  encryption
Noise
.NET Standard 1.3 implementation of the Noise Protocol Framework (revision 33 of the spec)
Stars: ✭ 124 (-7.46%)
Mutual labels:  encryption
Cryption
In-Browser AES File Encryption πŸ” with Data Integrity Check πŸ”
Stars: ✭ 114 (-14.93%)
Mutual labels:  encryption
Aes
Verilog implementation of the symmetric block cipher AES (Advanced Encryption Standard) as specified in NIST FIPS 197. This implementation supports 128 and 256 bit keys.
Stars: ✭ 131 (-2.24%)
Mutual labels:  encryption
Zeyple
Postfix filter/hook to automatically encrypt outgoing emails with PGP/GPG
Stars: ✭ 122 (-8.96%)
Mutual labels:  encryption
Underlock
Underlock makes it dead simple to encrypt and decrypt your data and files. It comes with little to no dependencies and has a very small API surface.
Stars: ✭ 128 (-4.48%)
Mutual labels:  encryption
Encrypt.to
Send encrypted PGP messages with one click
Stars: ✭ 116 (-13.43%)
Mutual labels:  encryption
Kubernetes Kms
πŸ”Azure Key Vault KMS plugin for Kubernetes
Stars: ✭ 118 (-11.94%)
Mutual labels:  encryption
Iocipher
make non-root mountable encrypted disk shares
Stars: ✭ 124 (-7.46%)
Mutual labels:  encryption
Securecompatibleencryptionexamples
A collection of secure encryption examples for encrypting strings and binary data.
Stars: ✭ 116 (-13.43%)
Mutual labels:  encryption
Knob
Key Negotiation Of Bluetooth (KNOB) attacks on Bluetooth BR/EDR and BLE [CVE-2019-9506]
Stars: ✭ 131 (-2.24%)
Mutual labels:  encryption
Joseswift
A framework for the JOSE standards JWS, JWE, and JWK written in Swift.
Stars: ✭ 114 (-14.93%)
Mutual labels:  encryption
Chest
Bash glue to encrypt and hide files
Stars: ✭ 123 (-8.21%)
Mutual labels:  encryption
Jasypt Spring Boot
Jasypt integration for Spring boot
Stars: ✭ 1,948 (+1353.73%)
Mutual labels:  encryption
Phoenix For Vk
Yet another VK client for Android
Stars: ✭ 131 (-2.24%)
Mutual labels:  encryption
Cross Platform Aes
Simple cross-platform encryption and decryption using AES
Stars: ✭ 127 (-5.22%)
Mutual labels:  encryption

Microsoft SEAL For Python

Microsoft SEAL is an easy-to-use open-source (MIT licensed) homomorphic encryption library developed by the Cryptography Research group at Microsoft.

pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code.

This is a python binding for the Microsoft SEAL library.

Contents

Build

  • Linux

    Clang++ (>= 5.0) or GNU G++ (>= 6.0), CMake (>= 3.12)

    # Optional
    sudo apt-get install build-essential cmake python3 python3-dev python3-pip
    
    # Get the repository or download from the releases
    git clone https://github.com/Huelse/SEAL-Python.git
    cd SEAL-Python
    
    # Numpy is essential
    pip3 install -r requirements.txt
    
    # Init the SEAL and pybind11
    git submodule init && git submodule update
    # Get the newest repositories
    git submodule update --remote
    
    # Build the SEAL lib
    cd SEAL
    cmake -S . -B build -DSEAL_USE_MSGSL=OFF -DSEAL_USE_ZLIB=OFF -DSEAL_USE_ZSTD=OFF
    cmake --build build
    cd ..
    
    # Run the setup.py
    python3 setup.py build_ext -i
    
  • Windows

    Visual Studio 2019 or newer is required. And use the x64 Native Tools Command Prompt for Visual Studio 2019 command prompt to configure and build the Microsoft SEAL library. It's usually can be found in your Start Menu.

    # Same as above
    # Build the SEAL library
    cmake -S . -B build -G Ninja -DSEAL_USE_MSGSL=OFF -DSEAL_USE_ZLIB=OFF -DSEAL_USE_ZSTD=OFF
    cmake --build build
    
    # Run the setup.py
    python setup.py build_ext -i
    

    Generally, the Ninja generator is better than the "Visual Studio 16 2019" generator, and there is more information in the Microsoft SEAL official illustrate.

Note

  • Serialize

    In most situations, you can use the SEAL's native serialize API to save the data, here is an example:

    cipher.save('cipher')
    
    load_cipher = Ciphertext()
    load_cipher.load(context, 'cipher')  # work if the context is valid.
    

    Support type: Encryptionparams, Ciphertext, Plaintext, SecretKey, Publickey, Relinkeys, Galoiskeys

    Particularly, if you want to use the pickle to serialize your data, you need to do these things like below:

    # 1. Modify the serializable object's header file in SEAL and switch the wrapper.
    python helper.py
    
    # 2. Rebuild the SEAL lib like above
    cmake --build build
    
    # 3. Run the setup.py
    python setup.py build_ext -i
    

    Then, you can pickle the data object like this:

    import pickle
    
    cipher.set_parms(parms)  # necessary
    cipher_dump = pickle.dumps(cipher)
    cipher_load = pickle.loads(cipher_dump)
    

    Generally, we don't use compression library.

  • Other

    There are a lot of changes in the latest SEAL lib, we try to make the API in python can be used easier, it may remain some problems we unknown, if any problems(bugs), Issue please.

    Email: [email protected]

FAQ

  1. ImportError: undefined symbol

    Build a shared SEAL library cmake . -DBUILD_SHARED_LIBS=ON, and get the libseal.so,

    then change the path in setup.py, and rebuild.

  2. ImportError: libseal.so... cannot find

    a. sudo ln -s /path/to/libseal.so /usr/lib

    b. add /usr/local/lib or the SEAL/native/lib to /etc/ld.so.conf and refresh it sudo ldconfig

    c. build in cmake.

  3. BuildError: C++17 at least

  4. ModuleNotFoundError: No module named 'seal'

    The .so or .pyd file must be in the current directory, or you have install it already.

Contributing

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].