aescrypt doesn't function with pv in pipeline

1

1

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?

Patrick

Posted 2012-03-01T15:29:56.813

Reputation: 43

No answers