Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am writing a bash script that pipes a file through pipe viewer to watch encryption progress. However, whenever I use aescrypt in the pipeline with pv, I get an error about not matching passwords. If the password is explicitly specified in plaintext on the command line, I don't have this problem (obviously), but this is very insecure. BTW, my test password was the single character 'a', so they did indeed match on input.

It is not supported either way:

$ pv -cN Encryption test.tar | aescrypt -e - -o test.tar.aes  
Enter password:   
Re-Enter password:    
Error: Passwords don't match.  
$ aescrypt -e test.tar | pv -cN Encryption >| test.tar.aes  
Enter password:   
Re-Enter password:   
Error: Passwords don't match.

However, this functions correctly (no pv):

$ cat test.tar | aescrypt -e - -o test.tar.aes

This functions as well (well, it writes the file correctly):

$ cat test.tar | pv -cN encryption | aescrypt -e - -o test.tar.aes  
Enter password: a  
Re-Enter password: a

When I put in the password, it is displayed in plain text on the screen.

Aescrypt is advertised to fully support the Linux pipeline. To my knowledge, pv only counts what data is passing through it, but doesn't modify it. What's wrong here?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.