mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 19:02:09 +00:00
Update package to 1.6.2. Security fix: - Updated bundled libsodium to 1.0.20-stable (2025-12-31 build) to resolve CVE-2025-69277 Refresh 001-always-compile-ed25519.patch for the updated source. Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
29 lines
714 B
Bash
Executable File
29 lines
714 B
Bash
Executable File
#!/bin/sh
|
|
|
|
[ "$1" = python3-pynacl ] || exit 0
|
|
|
|
python3 - << 'EOF'
|
|
import nacl.secret
|
|
import nacl.utils
|
|
import nacl.public
|
|
|
|
# Secret-key encryption (SecretBox)
|
|
key = nacl.utils.random(nacl.secret.SecretBox.KEY_SIZE)
|
|
box = nacl.secret.SecretBox(key)
|
|
message = b"secret message"
|
|
encrypted = box.encrypt(message)
|
|
decrypted = box.decrypt(encrypted)
|
|
assert decrypted == message
|
|
|
|
# Public-key encryption (Box)
|
|
alice_priv = nacl.public.PrivateKey.generate()
|
|
bob_priv = nacl.public.PrivateKey.generate()
|
|
alice_box = nacl.public.Box(alice_priv, bob_priv.public_key)
|
|
bob_box = nacl.public.Box(bob_priv, alice_priv.public_key)
|
|
|
|
msg = b"hello bob"
|
|
enc = alice_box.encrypt(msg)
|
|
dec = bob_box.decrypt(enc)
|
|
assert dec == msg
|
|
EOF
|