d2ray/image/crypt.sh
quackerd 083057956a
Some checks failed
continuous-integration/drone/push Build is failing
new
2021-04-22 05:01:45 -04:00

21 lines
419 B
Bash

#!/bin/sh
decrypt()
{
input=$1
key=$2
crypt_ret=$(echo $input | openssl enc -d -salt -aes-256-cbc -a -A -md sha512 -pbkdf2 -pass pass:$key)
}
encrypt()
{
input=$1
key=$2
crypt_ret=$(echo $input | openssl enc -e -salt -aes-256-cbc -a -A -md sha512 -pbkdf2 -pass pass:$key)
}
hash_sha256()
{
input=$1$2
crypt_ret=$(echo $input | openssl dgst -sha256 | sed -E "s/\(stdin\)= (.*)/\1/g")
}