User Tools

Site Tools


haas:fall2015:cprog:projects:sam0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
haas:fall2015:cprog:projects:sam0 [2015/10/29 12:21] – [Task] wedgehaas:fall2015:cprog:projects:sam0 [2015/10/29 12:26] (current) – [Sample execution: encode] wedge
Line 68: Line 68:
 </cli> </cli>
  
 +Without command-line nor cipher.key file:
  
 +<cli>
 +lab46:~/src/cprog/sam0$ ./encode-sam0
 +ERROR: key not found
 +lab46:~/src/cprog/sam0$ 
 +</cli>
 +
 +With 4 in the cipher.key file:
 +
 +<cli>
 +lab46:~/src/cprog/sam0$ ./encode-sam0
 +hello there
 +lipps xlivi
 +^D
 +lab46:~/src/cprog/sam0$ 
 +</cli>
 +
 +With 4 in the cipher.key file, decoding previous message:
 +
 +<cli>
 +lab46:~/src/cprog/sam0$ ./decode-sam0
 +lipps xlivi
 +hello there
 +^D
 +lab46:~/src/cprog/sam0$ 
 +</cli>
 +
 +Via positive command-line key, decoding:
 +
 +<cli>
 +lab46:~/src/cprog/sam0$ ./decode-sam0 2
 +jgnnq 
 +hello
 +^D
 +lab46:~/src/cprog/sam0$ 
 +</cli>
 +
 +You can also save typing, by providing your input via a here string (also a nice way to check for EOF):
 +
 +<cli>
 +lab46:~/src/cprog/sam0$ ./decode-sam0 2 <<< "jgnnq" 
 +hello
 +lab46:~/src/cprog/sam0$ 
 +</cli>
 =====Submission===== =====Submission=====
 To successfully complete this project, the following criteria must be met: To successfully complete this project, the following criteria must be met:
haas/fall2015/cprog/projects/sam0.1446121277.txt.gz · Last modified: 2015/10/29 12:21 by wedge