Mgmt. 298D-13: 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. * bytes.bin composed of all 256 bytes, in order. Examine. * Browse bytes.htm to see how your browser displays all 256 possible bytes. * Refer to Quick Reference Sheet (Class 4) 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] ==================================================================== Appended now is the file bytes.bin, which has all 256 possible bytes (in order). Bytes 000-031 normally are control codes not intended to be printed. Bytes 033-127 normally are intended to be printed as the usual keyboard characters (except for 127). Bytes 128-255, which require all 8 bits, are rendered as different characters depending on the program doing the rendering and perhaps on the chosen font. 000-- 001-- 002-- 003-- 004-- 005-- 006-- 007-- 008-- 009- - 010- - 011- - 012- - 013- - 014-- 015-- 016-- 017-- 018-- 019-- 020-- 021-- 022-- 023-- 024-- 025-- 026-- 027-- 028-- 029-- 030-- 031-- 032- - 033-!- 034-"- 035-#- 036-$- 037-%- 038-&- 039-'- 040-(- 041-)- 042-*- 043-+- 044-,- 045--- 046-.- 047-/- 048-0- 049-1- 050-2- 051-3- 052-4- 053-5- 054-6- 055-7- 056-8- 057-9- 058-:- 059-;- 060-<- 061-=- 062->- 063-?- 064-@- 065-A- 066-B- 067-C- 068-D- 069-E- 070-F- 071-G- 072-H- 073-I- 074-J- 075-K- 076-L- 077-M- 078-N- 079-O- 080-P- 081-Q- 082-R- 083-S- 084-T- 085-U- 086-V- 087-W- 088-X- 089-Y- 090-Z- 091-[- 092-\- 093-]- 094-^- 095-_- 096-`- 097-a- 098-b- 099-c- 100-d- 101-e- 102-f- 103-g- 104-h- 105-i- 106-j- 107-k- 108-l- 109-m- 110-n- 111-o- 112-p- 113-q- 114-r- 115-s- 116-t- 117-u- 118-v- 119-w- 120-x- 121-y- 122-z- 123-{- 124-|- 125-}- 126-~- 127-- 128-- 129-- 130-- 131-- 132-- 133-- 134-- 135-- 136-- 137-- 138-- 139-- 140-- 141-- 142-- 143-- 144-- 145-- 146-- 147-- 148-- 149-- 150-- 151-- 152-- 153-- 154-- 155-- 156-- 157-- 158-- 159-- 160-- 161-- 162-- 163-- 164-- 165-- 166-- 167-- 168-- 169-- 170-- 171-- 172-- 173-- 174-- 175-- 176-- 177-- 178-- 179-- 180-- 181-- 182-- 183-- 184-- 185-- 186-- 187-- 188-- 189-- 190-- 191-- 192-- 193-- 194-- 195-- 196-- 197-- 198-- 199-- 200-- 201-- 202-- 203-- 204-- 205-- 206-- 207-- 208-- 209-- 210-- 211-- 212-- 213-- 214-- 215-- 216-- 217-- 218-- 219-- 220-- 221-- 222-- 223-- 224-- 225-- 226-- 227-- 228-- 229-- 230-- 231-- 232-- 233-- 234-- 235-- 236-- 237-- 238-- 239-- 240-- 241-- 242-- 243-- 244-- 245-- 246-- 247-- 248-- 249-- 250-- 251-- 252-- 253-- 254-- 255--