[cs631apue] Encryption of stdin

Jan Schaumann jschauma at stevens.edu
Wed Nov 28 16:09:16 EST 2012


tparisi <tparisi at stevens.edu> wrote:
> I forgot to ask about stdin.  Are we to allow a user to enter  
> information from the command line and have it output the encrypted text  
> or are we only using files through redirection?

Your program will read from stdin and write to stdout.  Whatever the
user does with that, is up to them.  The following are all valid
invocations of the tool:

bfed -e -k feedfacebeefca4e <file >out
bfed -d -k feedfacebeefca4e <out | grep secr

echo 'Secret!' | bfed -e -k cafefacedeadbeef | bfed -d -k cafefacedeadbeef | cat

$ bfed -e -k abcdef0123456789
type something here
and there
then end with
^D

(The last example yields encrypted (ie binary) data being written to the
terminal, bu that is the user's fault.)

-Jan


More information about the cs631apue mailing list