All Projects → istommao → Cryptokit

istommao / Cryptokit

Licence: mit
cryptokit is a cryptography kit

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Cryptokit

Mintotp
Minimal TOTP generator in 20 lines of Python
Stars: ✭ 678 (+3666.67%)
Mutual labels:  cryptography
Javascript Obfuscator
A powerful obfuscator for JavaScript and Node.js
Stars: ✭ 8,204 (+45477.78%)
Mutual labels:  cryptography
Sdk Js
Tanker client-side encryption SDK for JavaScript
Stars: ✭ 786 (+4266.67%)
Mutual labels:  cryptography
Applied Crypto Hardening
Best Current Practices regarding secure online communication and configuration of services using cryptography.
Stars: ✭ 690 (+3733.33%)
Mutual labels:  cryptography
Acra
Database security suite. Database proxy with field-level encryption, search through encrypted data, SQL injections prevention, intrusion detection, honeypots. Supports client-side and proxy-side ("transparent") encryption. SQL, NoSQL.
Stars: ✭ 726 (+3933.33%)
Mutual labels:  cryptography
Blockchain
Compilation of useful documents and scientific papers about Blockchain & cryptocurrencies.
Stars: ✭ 751 (+4072.22%)
Mutual labels:  cryptography
Rando.js
The world's easiest, most powerful random function.
Stars: ✭ 659 (+3561.11%)
Mutual labels:  cryptography
Airassembly
Low-level language for encoding AIR of computations
Stars: ✭ 18 (+0%)
Mutual labels:  cryptography
Keys
Key management is hard
Stars: ✭ 733 (+3972.22%)
Mutual labels:  cryptography
Liboqs
C library for prototyping and experimenting with quantum-resistant cryptography
Stars: ✭ 775 (+4205.56%)
Mutual labels:  cryptography
Maskbook
The portal to the new, open internet. ([I:b])
Stars: ✭ 691 (+3738.89%)
Mutual labels:  cryptography
Blockchain
📖Code for Blockchain Demo
Stars: ✭ 717 (+3883.33%)
Mutual labels:  cryptography
Pynacl
Python binding to the Networking and Cryptography (NaCl) library
Stars: ✭ 761 (+4127.78%)
Mutual labels:  cryptography
Challenge Bypass Extension
Privacy Pass: a privacy-enhancing protocol and browser extension.
Stars: ✭ 679 (+3672.22%)
Mutual labels:  cryptography
Ciphey
⚡ Automatically decrypt encryptions without knowing the key or cipher, decode encodings, and crack hashes ⚡
Stars: ✭ 9,116 (+50544.44%)
Mutual labels:  cryptography
Libsodium.js
libsodium compiled to Webassembly and pure JavaScript, with convenient wrappers.
Stars: ✭ 665 (+3594.44%)
Mutual labels:  cryptography
Sodium compat
Pure PHP polyfill for ext/sodium
Stars: ✭ 736 (+3988.89%)
Mutual labels:  cryptography
Riceteacatpanda
repo with challenge material for riceteacatpanda (2020)
Stars: ✭ 18 (+0%)
Mutual labels:  cryptography
Tf Encrypted
A Framework for Encrypted Machine Learning in TensorFlow
Stars: ✭ 832 (+4522.22%)
Mutual labels:  cryptography
Tfhe
TFHE: Fast Fully Homomorphic Encryption Library over the Torus
Stars: ✭ 768 (+4166.67%)
Mutual labels:  cryptography

Build Status codecov PyPI PyPI

cryptokit

cryptokit is a cryptography kit base on Cryptography(https://github.com/pyca/cryptography)

Document

You can find more information in the cryptokit documentation.

Feature Support

  • AES Cryptography
  • RSA Cryptography

Installation

pip install cryptokit

AES usage

>>> from cryptokit import AESCrypto
>>> message = "hello cryptokit"
>>> crypto = AESCrypto('WDMG1e38igW53YuxkE0SsKUDeLbULAtL', 'm2VYHdx41zRgvg6f')
>>> data = crypto.encrypt(message)
>>> b'\xaa<\x9d\xe9\xde\x0b\xd7\xe9\xfd\xac\xfc\xdd\x9f\xe2V\xd4'
>>> crypto.decrypt(data)
>>> 'hello cryptokit'

RSA usage

>>> from cryptokit import RSACrypto
>>> private_key = RSACrypto.generate_private_key(2048)
>>> public_key = private_key.public_key()
>>> message = 'Hello cryptokit'
>>> ciphertext = RSACrypto.encrypt(message, public_key, algorithm='sha256')
>>> plaintext = RSACrypto.decrypt(ciphertext, private_key, algorithm='sha256')
>>> plaintext == message
True

PFX usage

>>> from cryptokit import load_pfx, get_pubkey_from_pfx
>>> pkcs12 = load_pfx(pfx_file, password='password')
>>> cert = pkcs12.get_certificate()
>>> pubkey = get_pubkey_from_pfx(pfx_file, password='password')
# or use cert get pubkey
>>> pubkey = cert.get_pubkey().to_cryptography_key()

>>> from cryptokit import generate_pfx
>>> pfx_data = generate_pfx(cert, friendly_name, private_key)

Create csr

from cryptokit import generate_csr
from cryptokit.rsa import RSACrypto

private_key = RSACrypto.generate_private_key(2048)
payload = {
    'country_name': 'US',
    'state_or_province': 'California',
    'locality_name': 'San Francisco',
    'org_name': 'My Company',
    'common_name': 'mysite.com',
    'dns_list': ['mysite.com', 'www.mysite.com', 'subdomain.mysite.com']
}

csr_data = generate_csr(private_key, encoding='pem', algorithm='sha256', **payload)

with open('/path/to/csr.pem', 'wb') as f:
    f.write(csr_data)

ChangeLog

changelog

License

MIT. See LICENSE for more details.

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].