
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
pycryptomod
Advanced tools
# Example usage:
plaintext = "Hello, World!"
key = 3
encrypted_text = caesar_cipher(plaintext, key)
print("Encrypted:", encrypted_text)
decrypted_text = caesar_cipher(encrypted_text, key, decrypt=True)
print("Decrypted:", decrypted_text)
# Example usage:
encrypted_text = monoalphabetic_cipher(plaintext, key)
print("Encrypted:", encrypted_text)
decrypted_text = monoalphabetic_cipher(encrypted_text, key, decrypt=True)
print("Decrypted:", decrypted_text)
# Example usage:
plaintext = "HELLO"
keyword = "KEY"
print("Plaintext:", plaintext)
print("Keyword:", keyword)
encrypted_text = vigenere_cipher(plaintext, keyword)
print("Encrypted:", encrypted_text)
decrypted_text = vigenere_cipher(encrypted_text, keyword, decrypt=True)
print("Decrypted:", decrypted_text)
# Example usage:
plaintext = "Hello, AES!"
key = get_random_bytes(16) # 128-bit key
print("Plaintext:", plaintext)
ciphertext = aes_encrypt(plaintext, key)
print("Ciphertext:", ciphertext.hex())
decrypted_text = aes_decrypt(ciphertext, key)
print("Decrypted:", decrypted_text)
# Example usage:
plaintext = "Hello, DES!"
key = get_random_bytes(8) # 64-bit key
print("Plaintext:", plaintext)
ciphertext = des_encrypt(plaintext, key)
print("Ciphertext:", ciphertext.hex())
decrypted_text = des_decrypt(ciphertext, key)
print("Decrypted:", decrypted_text)
# Example usage:
plaintext = "Hello, 3DES!"
key = get_random_bytes(24) # 192-bit key for 3DES
print("Plaintext:", plaintext)
ciphertext = triple_des_encrypt(plaintext, key)
print("Ciphertext:", ciphertext.hex())
decrypted_text = triple_des_decrypt(ciphertext, key)
print("Decrypted:", decrypted_text)
#Example Usage(generate using a simple p and q):
public, pvt = generateMinRSA_keys(11,13)
plaintext = "Hello World"
cipher = MinRSA_encrypt(plaintext, public)
print(cipher)
print(MinRSA_decrypt(cipher, pvt))
# Example usage(Signature Verification):
message_to_sign = "This is a signed message."
signature = create_rsa_signature(message_to_sign, private_key)
is_valid_signature = verify_rsa_signature(message_to_sign, signature, public_key)
print("Signature is valid:", is_valid_signature)
# Example usage(Key Generation):
plaintext = "Hello, RSA!"
keypair = generate_rsa_keypair()
public_key = keypair.publickey()
private_key = keypair
# Example usage(RSA using pycryptodome):
ciphertext = rsa_encrypt(plaintext, public_key)
decrypted_message = rsa_decrypt(ciphertext, private_key)
print("Decrypted message:", decrypted_message)
# Example usage:
p = 23 # A small prime number for demonstration purposes
g = 5 # A primitive root modulo p
# Alice and Bob perform Diffie-Hellman key exchange
alice_private_key, alice_public_key = diffie_hellman(p, g)
bob_private_key, bob_public_key = diffie_hellman(p, g)
# Both Alice and Bob compute the shared secret key
shared_secret_alice = (bob_public_key ** alice_private_key) % p
shared_secret_bob = (alice_public_key ** bob_private_key) % p
# Convert the shared secret to bytes (for AES key)
shared_secret_bytes = shared_secret_alice.to_bytes((shared_secret_alice.bit_length() + 7) // 8, byteorder='big')
# Derive AES key from shared secret
aes_key = derive_aes_key(str(shared_secret_bytes))
# Use the derived AES key for AES encryption and decryption
plaintext = "Hello, Diffie-Hellman!"
ciphertext, tag, nonce = aes_encrypt(plaintext, aes_key)
decrypted_text = aes_decrypt(ciphertext, tag, nonce, aes_key)
print("Original:", plaintext)
print("Decrypted:", decrypted_text)
FAQs
A simpler plug and play module for prototyping cryptography techniques
We found that pycryptomod demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.