I try to encrypt some loads, here is a minimum working example (is RSA private key)
to_be_signed="2f93992bb1db9cab0b3b8fc2de0a2863"
#to_be_signed="7d6d2a584a227574e1c113aab56ea490"
# Sign poly_1305 with private key
signature=$(openssl dgst \
-sha256 \
-sign ${privkey} \
<(echo "${to_be_signed}")
)
if [ ${?} -eq 0 ]; then
echo "[*] to_be_signed correctly signed"
else
echo "ERROR signing to_be_signed" && exit 2
fi
First to_be_signed
does not generate any warning, second to_be_signed
does:
warning: command substitution: ignored null byte in input
What on hell does that mean? For some particular values, i get this bash-related warning; is there any flow on the way i use to sign the value ?
I definitely need to play with variables in order to keep their values in memory, i.e. not stored in temporary files on disk. This is a strong requirement.