关于这个问题的加密变得更加有趣。我从以下脚本开始:
while read CTFlist; do
#next we need to create ctfs padded with zeros as a variable
ctfPadded=(printf ${ctflist}00000000)
#then call rc2 key as variable
rc2Key="TemporaryRC2Key1"
#next create a hex version of the rc2 key
hexRc2Key=$(printf "${rc2Key}"|xxd -p)
#next to create the encrypted ctf file using the hex rc2 key
ctfEnc= $(printf "${ctfPadded}" |xxd -r -p |openssl enc -rc2-cbc -nopad -K "${hexRc2Key}" -iv 0000000000000000 |xxd -plain|tr -d '\n')
#Now we call all our variables and output to a single file.
echo ${ctfPadded},${ctfEnc^^} >> output.csv
#calling end of file with the input file of ctflist.csv
done <CTFlist.csv
#have to change the output file to dos version or it wont open on a windows comp
unix2dos output.csv
output.csv文件在列表下方的每一行上都有printf。为什么?有什么不对吗?
您在此处省略了命令替换中的美元符号:
ctfPadded=(printf ${ctflist}00000000)
该行应显示为:
ctfPadded=$(printf ${ctflist}00000000)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句