Mgmt. 298D: Electronic
Commerce
Prof. A. Geoffrion
DEMO:
Compression, Encoding,
Encrypting, Archiving Files
Preliminaries
Memory media, most files organized into bytes:
{FirstByte, SecondByte, ThirdByte,
etc.}
1 byte = 8 bits (bit = 0 or 1) = 1 character:
{8th bit, 7th
bit, …, 1st bit} = character
Ex: Lower case "a"
is the 97th character, or
0 1
1 0 0 0 0 1
(bits)
128 64 32 16 8
4 2 1 (values)
ASCII or text files use only 7 bits (8th
bit 0) à can make 128 characters.
Binary or data files use all 8 bits à
can make 256 characters.
ASCII (American Standard Code for Information Exchange):
.bat, .cpt, .htm, .html, .hqx, .hx, .ini, .ps, .rtf, .shar, .tex, .txt,
.uu, .uue, btoa. Other codes exist, e.g., EBCIDIC.
Binary: compressed and image and sound files (e.g., .aiff,
.arc, .arj, .au, .bin, .eps, .gif, .gz, .jpeg, .jpg, .lha, .lzh, .mod,
.mov, .mpeg, .pcx, .ppt, .sea, .sit, .snd, .tar, .tgz, .tiff, .wav, .z,
.Z, .zip, .zoo), most executables (e.g., .bin, .com, .dll, .drv, .exe,
.sys), and most spreadsheet, database, and word processing files.
1. Start with file mixed
: ordinary text + bytes.bin. Examine.
Compression
born of limited storage space & bandwidth (download time)
2. Compress mixed
using WinZip or pkzip.exe to get mixed.zip.
[Mac: StuffIt à
mixed.sit]
Encoding
born of 7-bit communications limitations (SMTP, Usenet, …)
3. Encode mixed
with uuencode.com
to get mixed.uue.
[Mac: StuffIt à mixed.hqx]
Encryption
born of security & privacy needs
4. Encrypt mixed
with PGP to get mixed.pgp.
[Mac: PGP available; StuffiIt does single-key encryption]
Archiving
born of need to manage natural file groupings
5. Archive all 4 files with WinZip to get archive.zip.
Move to new folder. [Mac: StuffIt à
mixed.sit]
Examine
Size change? 8-bit char? Evident pattern?
Inversion
6. Unpack archive.zip
with WinZip to get original 4 files. Verify mixed
correct, delete. [Mac: use StuffIt or
StuffIt Expander]
7. Decrypt mixed.pgp
with PGP to get mixed. Verify, delete.
8. Decode mixed.uue
with uudecode.com
to get mixed. Verify, delete.
[Mac: use StuffIt or StuffIt Expander for
.hqx, UULite for .uue]
9. Uncompress mixed.zip
using WinZip or pkunzip.exe to get mixed.
Verify. [Mac: use Zip-It for .zip,
StuffIt or StuffIt Expander for .sit]