...
This commit is contained in:
16
examples/data/encrypt_decrypt.vsh
Executable file
16
examples/data/encrypt_decrypt.vsh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
|
||||
|
||||
import freeflowuniverse.herolib.crypt.aes_symmetric { decrypt, encrypt }
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
|
||||
msg := 'my message'.bytes()
|
||||
console.print_debug('${msg}')
|
||||
|
||||
secret := '1234'
|
||||
encrypted := encrypt(msg, secret)
|
||||
console.print_debug('${encrypted}')
|
||||
|
||||
decrypted := decrypt(encrypted, secret)
|
||||
console.print_debug('${decrypted}')
|
||||
|
||||
assert decrypted == msg
|
||||
Reference in New Issue
Block a user