File: encrypt_msg.py

package info (click to toggle)
libopaque 1.0.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,064 kB
  • sloc: ansic: 7,701; python: 570; javascript: 379; makefile: 269; java: 195; php: 181; erlang: 121; ruby: 61; sh: 12
file content (9 lines) | stat: -rw-r--r-- 368 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
#!/usr/bin/env python3

import pysodium, binascii

export_key = binascii.unhexlify('ed23adbfc61c9462ee501bee51c9ba75e21915b550b00eb1f5babde5f251dea91897d87200e73013b92a81d74e2a951d9fe017ada17af570c537ef7b061f38c2')
msg = b"OPAQUE is versatile, it can auth, protect at-rest and in-flight!"

res = b''.join(bytes([x^y]) for x,y in zip(export_key, msg))
print(res.hex())