79379393

Date: 2025-01-22 22:48:20
Score: 1
Natty:
Report link

Using the cryptography library (the linked ed25519 library looks abandoned at this point):

from cryptography.hazmat.primitives import serialization

with open('private_key.pem', 'rb') as f:
    # returns Ed25519PrivateKey
    ed_priv = serialization.load_pem_private_key(f.read(), password=None)
    
signature = ed_priv.sign(b"my authenticated message") 

For other methods see https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ed25519/

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: AFOC