A hash is one way, an encoding is reversible by anyone, and encryption needs a key. This set checks that you can tell the three apart, read the signs in the output of each, and say what each one is actually good for.
Each one is marked as you go, and the explanation arrives straight after, which is
the part worth reading.
4 questions, marked as you go.
Tasks
These need your own device. Run the command in Termux, then paste what it printed.
The marking looks at what the output means, so spacing, version numbers and
ordering do not matter. If you have not installed anything yet, the
lesson covers the setup.
Hash, encode and encrypt the same text
This writes a small file, then does three things to it: a hash, a base64 encoding and an encryption with a passphrase. Read the four output lines and match each one to the job that produced it.
Run this in Termux
On your own device. Nothing on this page executes it. The command runs in
your terminal, and this box only reads what you paste back.
The hash is the line of 64 hex characters. The base64 of the same text is short and reversible. The encrypted line starts with the salted header, and the last line is the text coming back.
the SHA-256 hash of the file is printed
the base64 form, which reverses with no key
the encrypted copy carries the salted header
the commands actually ran
What a good answer looks like
Four lines. The first is the SHA-256 hash of the file, 64 hex characters followed by the filename, and it is a summary that cannot be reversed. The second is the base64 form, aGVsbG8gdGVybXV4, which looks scrambled but which anyone can decode with no key. The third starts with U2FsdGVkX1, the salted header that shows a passphrase was used, and it changes on every run. The last line is hello termux, the text coming back only because the same passphrase was supplied. That is the difference between the three in one screen.
Marking your own work
Both halves of this are checked in your browser, with no server involved, so nothing
stops you from pasting output you did not run. The tasks are written so that the
easiest way to pass one is to actually do it and read the result, which is the whole
intention.