]>
iEval git - authen-passphrase-scrypt.git/blob - scrypt-1.2.1/tests/05-system-scrypt-encrypt-decrypt.sh
5 reference_file
="${scriptdir}/test_scrypt.good"
6 encrypted_file_1
="${out}/sys-scrypt.enc"
7 decrypted_file_1
="${out}/sys-scrypt.txt"
8 encrypted_file_2
="${out}/our-scrypt.enc"
9 decrypted_file_2
="${out}/our-scrypt.txt"
12 if [ -z "${system_scrypt}" ]; then
13 printf "no suitable system scrypt: "
14 # Inform test suite that we are skipping.
16 echo "-1" > ${c_exitfile}
20 # Encrypt a file with our scrypt.
23 echo ${password} | ${c_valgrind_cmd} ${bindir}/scrypt \
24 enc
-P -t 1 ${reference_file} ${encrypted_file_1}
25 echo $?
> ${c_exitfile}
28 # Use the system scrypt to decrypt the file we just
29 # encrypted. Don't use valgrind for this.
32 echo ${password} |
${system_scrypt} \
33 dec
-P ${encrypted_file_1} ${decrypted_file_1}
34 echo $?
> ${c_exitfile}
37 # The decrypted file should match the reference.
39 if cmp -s ${decrypted_file_1} ${reference_file}; then
45 # Encrypt a file with the system scrypt. Don't use
49 echo ${password} |
${system_scrypt} \
50 enc
-P -t 1 ${reference_file} ${encrypted_file_2}
51 echo $?
> ${c_exitfile}
54 # Use our scrypt to decrypt the file we just encrypted.
57 echo ${password} | ${c_valgrind_cmd} ${bindir}/scrypt \
58 dec
-P ${encrypted_file_2} ${decrypted_file_2}
59 echo $?
> ${c_exitfile}
62 # The decrypted file should match the reference.
64 if cmp -s ${decrypted_file_2} ${reference_file}; then
This page took 0.055839 seconds and 5 git commands to generate.