A NUMERIC COMPRESSION ALGORITHM FOR THE HP PRIME CALCULATOR DR. JACKIE F. WOLDERING HHC SEPT. 26 27, 2015 NASHVILLE, TN.
ABSTRACT VCR Plus+ Instant Programmer uses short (1 8 digit) codes to encrypt television listing information. Each VCR Plus+ PlusCode decrypts into channel number, date, start time and program duration. These codes were published in periodicals with TV listings and used to simplify VCR programming. Encryption and decryption methods are illustrated through a program on the HP Prime calculator. Codes are obsolete; information is for mathematical and calculator research purposes only. VCR Plus+, Instant Programmer, PlusCodes and CallSet are all trademarks of Rovi Corporation (formerly Macrovision Solutions Corporation and successors to Gemstar TV Guide International, Inc.).
HISTORY OF THE ALGORITHM System was invented by Dr. Henry C. Yuen and Dr. Daniel S. Kwoh to simplify VCR programming. Overall goal was to make recording a program on a VCR as simple as entering a 1 8 digit code. Algorithm uses a Huffman style encoding to map common times and channels to shortest codes. Short duration, prime time, low channel number, early in month might map to 4 digits or less. Example: Encoding channel 2 at 7:30 P.M. for 30 minutes on 9/1/2015 maps to the code value 59. Longer duration, odd starting time, higher channel, later in month might map to 7 8 digit codes. Example: Encoding channel 150 at 3:00 A.M. for 6 hours on 9/30/2015 maps to the code 14118837.
PARAMETERS OF THE ALGORITHM 8 digit code allows for a maximum of 10^8 or 100,000,000 possible codes for any given month. Maximum 31 days per month accommodated in a 5 bit field with values 0 31 (last value unused). 288 possible starting times (every 5 minutes = 12 per hour * 24 hours per day = 288 starting times). 56 possible durations = 36 durations in 5 minute increments from 5 180 minutes (0:05 to 3:00 hours) plus an additional 20 durations in 15 minute increments from 195 480 minutes (3:15 to 8:00 hours). 192 possible channels can be accommodated using this encoding system (inadequate for cable today). 32 days * 288 start times * 56 durations * 192 channels = 99,090,432 codes, just under 100,000,000!
LISTS USED BY THE ALGORITHM HP Prime uses lists L1 and L2 to provide two way mapping of 192 time/duration combinations. 48 possible starting times (every half hour) and 4 possible durations (0:30, 1:00, 1:30, 2:00). This part of the algorithm maps the most popular shows to the least number of code digits. Lists L3 and L4 are used to scramble and unscramble 7 digit and 8 digit codes, respectively. List L5 assigns a name to a channel number, and may be adjusted to the user s local channels. Channel names not shown by VCR Plus+ devices, only included in HP program for convenience. Function LIST() creates L1 L5 and is called if program finds SIZE of L1 or L2 not equal to 192.
TIME FRAME OF THE ALGORITHM Algorithm good for 100 years from March 1, 1989 to February 28, 2089, covering 1200 months! Encryption creates different codes for same time/duration/channel/day during each month/year. 6 digit codes and less are on a 16 year cycle, while 7 8 digit codes are unique for 100 year cycle. 1 6 digit codes for Sept., 2015 would match those for 9/1999, 9/2031, 9/2047, 9/2063, 9/2079. Additional encryption also used to control distribution of codes, prevent reverse engineering. Gemstar Development Corporation licensed codes to magazines, newspapers and TV Guide. Additional worldwide licensing used the names G Code (Japan/China/New Zealand/Australia), VideoPlus+ (Ireland and United Kingdom) and ShowView (rest of Europe and South Africa).
VCR PLUS+ VIP 8 & VIP 18 INSTANT PROGRAMMER Gemstar VIP 8 Programmer VCR Plus+ VIP 18 Programmer
VCR PLUS+ VIP 18M AND CPS 1 CONTROL TOWER VCR Plus+ VIP 18M w/callset VCR Plus+ CPS 1 Control Tower
OTHER VCR PLUS+ PROGRAMMABLE DEVICES Panasonic Light Tower Philips Magnavox 4 Head VCR
HISTORY OF VCR PLUS+ PLUSCODES PlusCodes were published in TV listings starting March, 1989 and ceased publication in May, 2010. PlusCodes were in 500+ periodicals in U.S.A., with peak distribution in the late 1990s, early 2000s. US patent #5,335,079 8/2/1994 by Henry C. Yuen & Daniel S. Kwoh, assigned to Gemstar Development Corporation for Apparatus and Method Using Compressed Codes for Recorder Preprogramming Gemstar International Group Ltd. bought TV Guide, Inc. from Rupert Murdoch s News Corporation on October 5, 1999 for $9.2 billion in Gemstar stock. Unfortunately, tech bubble burst soon thereafter. Gemstar TV Guide International, Inc. was sold to Macrovision on December 7, 2007 for $2.8 billion. PlusCodes discontinued due to DVRs, cable networks with 1000+ channels, reduced newspaper circulation, conversion of broadcast television from analog to digital and streaming video services. Consumers who want to use VCR Plus+ devices, can obtain codes from www.vcrplus.com.
DECODING ALGORITHM OVERVIEW FROM CRYPTOLOGIA
THE HP PRIME DECODING PROGRAM FLOW CHART Year, Month 1 8 Digit PlusCode from Newspaper, Magazine, Internet DECO FUN1 MTOP SHUF TWID PlusCode, Year, Month, Day, Day of Week, Starting Time, Ending Time, Program Length, Channel Number and Channel Identifier
THE HP PRIME ENCODING PROGRAM FLOW CHART Year, Month, Day, Start Time, Program Length, Channel Number ENCO ITWD ITLV IMTP IFUN PlusCode, Year, Month, Day, Day of Week, Starting Time, Ending Time, Program Length, Channel Number and Channel Identifier
INTERESTING HP PRIME CODING TECHNIQUES Original code is unmasked by performing repeated additions of digits to form a unique new number. Length looping technique makes sure that translated code is same length as original code. Shirriff, Welch and Kinsman described this as mod 10 no carry matrix multiplication by key 68150631, but 68150631 is mod 10 remainders from 1, 1+2, 1+2+3,..., 1+2+3+4+5+6+7+8 derived from looping. HP Prime program uses n:=reverse(asc(string(code)) 48); to parse code digits into an array. HP Prime program uses RETURN EXPR(CHAR(REVERSE(n)+48)); where 48 converts ASCII to/from binary. Decoding uses L1 to map codes to time slots, while encoding uses L2 to do the reverse mapping.
INTERESTING CODING TECHNIQUES (CONTINUED) MTOP performs mod 10 no carry matrix multiplication in the form of a loop to calculate the offset. Table L3 is used for 7 digit and L4 is used for 8 digit numbers to do additional scrambling/unscrambling. SHUF uses BITAND function to rearrange bits; TWID uses CASE/IF/THEN/END multiway branching. PLUS menu program uses the CHOOSE command to decide between DECODE and ENCODE. PLUS saves screen size from whatever app was previously running, sets to 320 x 220 pixels, restores. PLUS menu uses RECT and TEXTOUT commands to draw and fill boxes, FREEZE to display output.
RUNNING THE HP PRIME DECODING PROGRAM
RUNNING THE HP PRIME ENCODING PROGRAM
NOTES FOR RUNNING DECODING AND ENCODING Decoding needs year (1989 2089), month (1 12) and code (1 99999999). Valid 3/1/1989 2/28/2089. Encoding needs year and month as above, day from 1 31 (Feb: 1 28/29, Apr, Jun, Sep, Nov: 1 30). Encoding start time is in 24 hour HHMM format with HH=00 23 hours and MM=00 55 minutes. Encoding start time minutes should be in 5 minute increments 0, 5, 10, 15,, 55 minutes. Encoding program length is in HMM format, where H=0 8 hours and MM=00 55 minutes. Encoding program length can be in 5 minute increments from 0:05 to 3:00 (5 minutes to 3 hours), and in 15 minute increments from 3:15 to 8:00 (3 hours 15 minutes to 8 hours). Max length is 8 hours. Encoding channel numbers range from 1 to 192. Out of range arguments will be set to min/max. It is possible to create some codes that give Err: CODE or Err: DATE on real VCR Plus+ devices.
FINAL THOUGHTS Program was originally attempted on an HP 50G, but it was rather slow and difficult to run correctly. HP Prime program is based on public domain program vcrpp1.c written in C programming language. Program vcrpp1.c and corrected program vcrpp2.c are in the directory along with HP Prime program. Shirriff, Welch and Kinsman paper Decoding a VCR Controller Code and update are also in directory. Individual functions within the PLUS program can be referenced, such as DOTW(9, 26, 2015) = SAT. Entering and canceling more than 200 codes into a VCR Plus+ Instant Programmer will lock it up! There is an entirely separate group of 100,000,000 one day codes starting with 0; algorithm unknown! VCR Plus+ devices are collectible electronics. Check ebay, thrift stores and garage sales for low prices.
REFERENCES 1) Wikipedia Video Recorder Scheduling Algorithm https://en.wikipedia.org/wiki/video_recorder_scheduling_code. 2) Wikipedia Gemstar TV Guide International https://en.wikipedia.org/wiki/gemstar TV_Guide_International. 3) H.C. Yuen & D.S. Kwoh, Apparatus and Method for Using Compressed Code for Recorder Programming, U.S. Patent #5,335,079, Aug. 2, 1994, https://patentimages.storage.googleapis.com/pdfs/us5335979.pdf. 4) K. Shirriff, C. Welch, A. Kinsman Decoding a VCR Controller Code Cryptologia, 16(3), July 1992, pp 227 234. 5) K. Shirriff VCR Controller Code: Additional Notes http://files/righto.com/papers/vcr1.html. 6) Anonymous VCRPlus+ Encoding, Decoding and Regression Test Code http://www.cs.cmu.edu/~dst/vcrplus+/. 7) Officially generated and supported VCRPlus+ PlusCodes may be found at: www.vcrplus.com.
ANY QUESTIONS? Thank you for attending HHC 2015 and for participating in this presentation!