-
Notifications
You must be signed in to change notification settings - Fork 0
Tutorial
cardinal9999 edited this page Sep 2, 2021
·
15 revisions
CryptoQuail has tons of confusing features, but here is a crash course guide to the Python CryptoQuail package.
CryptoQuail has 3 types of encrypters in its module.
from cryptoquail import encryption as stream, block_cipher as block, rsa
# Stream Cipher #
a = stream.encrypt_string("message you want to encrypt", "secret key") # Key must be shared
b = stream.decrypt_string(a, "secret key")
# Block Cipher #
c = block.encrypt("message", "key") # Key must be shared
d = block.decrypt(c, "key")
# RSA #
e = rsa.generate_d(p, q, e) # Use a calculator to generate e.
f = rsa.encrypt(m, n, e)
g = rsa.decrypt(c, d, n)
from cryptoquail import hash
hash.crc32("password") #CRC32
hash.sha256("password") #SHA-256
hash.ψ_hash("password") #ψ-hash (not really secure)
hash.shake("password") #shake
from cryptoquail import securerandom as random
# Switch from CSPRNG to PRNG
random.toggle_security(0)
# Random integer
print(random.randint(10, 20))
# Random password
print(random.password(10))
# Shuffle a list
print(random.shuffle("abcdefghijklmnop"))
# Alphanumeric string
random.token_alphanumeric(10)
# XKCD password
random.xkcd(words=7, add_numbers=2)
# Note: You can only access random.xkcd if you have requests installed. If you don't go to your command prompt and type in "pip install requests".
from cryptoquail import primegen
from cryptoquail import passwordcheck as pwd_check
# Generate large prime numbers
primes = primegen.generate(range_ = 100, start = 11111)
# Check a password
score = pwd_check.check_password("a $tr0n9 pa55w0rd eXamp1e")
import encrypt from "encrypt";
import decrypt from "encrypt";
import alphanumeric from "random";
// Encrypt a string
var a = encrypt("string", "key");
var b = decrypt(a, "key");
// Random alphanumeric password
var token = alphanumeric(10);
Generate large prime numbers: https://asecuritysite.com/encryption/random3?val=1280