Article View: comp.security.unix
Article #2Keyprint: PostScript key printing program for S/Key
From: Rik Harris
Date: Wed, 16 Feb 1994 03:14
Date: Wed, 16 Feb 1994 03:14
1321 lines
33835 bytes
33835 bytes
Due to popular demand, I am posting the keyprint program I mentioned in
comp.security.unix last week. You can also ftp it (and later versions,
if I ever get around to adding all the great features I want :-) from:
ftp.vifp.monash.edu.au:/pub/src/security
(PS. If someone who knows more PostScript than me wants to carve up
the PostScript file, please do so, and send the results back to me.
I'm sure it's _much_ bigger than it needs to be, like about 10 times
bigger!)
From the README:
This is keyprint: a quick hack for printing S/Key keys on a small piece
of paper, twice the size of a credit card for easy storage in a
wallet, card holder, etc. It produces a PostScript file which can be
printed and then trimmed to size:
hn38925
+----------------------------------------+
| 1 af fd alfal 26 fd s fdas da |
| 2 af fd alfal 27 fd s fdas da |
| 3 af fd alfal 28 fd s fdas da |
| . . |
| . . |
| 24 af fd alfal 49 fd s fdas da |
| 25 af fd alfal 50 fd s fdas da |
+----------------------------------------+
| 51 af fd alfal 76 fd s fdas da |
| 52 af fd alfal 77 fd s fdas da |
| 53 af fd alfal 78 fd s fdas da |
| . . |
| . . |
| 74 af fd alfal 98 fd s fdas da |
| 75 af fd alfal 99 fd s fdas da |
+----------------------------------------+
rik.
here it is:
-----------8<-----------8<-----------8<-----------8<-------------
#!/bin/sh
# This is a shell archive (shar 3.44)
# made 02/16/1994 00:29 UTC by rik.harris@fulcrum.com.au
#
# existing files will NOT be overwritten unless -c is specified
# This format requires very little intelligence at unshar time.
# "if test", "echo", "true", and "sed" may be needed.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 2064 -rw-r--r-- README
# 24274 -rw-r--r-- keyblank.ps
# 1137 -rwxr-xr-x keyprint
#
# ============= README ==============
if test -f 'README' -a X"$1" != X"-c"; then
echo 'x - skipping README (File already exists)'
else
echo 'x - extracting README (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'README' &&
XThis is keyprint: a quick hack for printing S/Key keys on a small piece
Xof paper, twice the size of a credit card for easy storage in a
Xwallet, card holder, etc. It produces a PostScript file which can be
Xprinted and then trimmed to size:
X
X hn38925
X +----------------------------------------+
X | 1 af fd alfal 26 fd s fdas da |
X | 2 af fd alfal 27 fd s fdas da |
X | 3 af fd alfal 28 fd s fdas da |
X | . . |
X | . . |
X | 24 af fd alfal 49 fd s fdas da |
X | 25 af fd alfal 50 fd s fdas da |
X +----------------------------------------+
X | 51 af fd alfal 76 fd s fdas da |
X | 52 af fd alfal 77 fd s fdas da |
X | 53 af fd alfal 78 fd s fdas da |
X | . . |
X | . . |
X | 74 af fd alfal 98 fd s fdas da |
X | 75 af fd alfal 99 fd s fdas da |
X +----------------------------------------+
X
XWarning: If you don't have a secure network, then it is not a good
Xidea to print this key set on a network printer. It might be obvious,
Xbut you never know.
X
X
XINSTALLATION
X
X1 Place the keyblank.ps file in the same directory as the key
Xand keyinfo commands.
X2 Modify keyprint's $dir= line to reflect this
X3 Make sure the perl line in keyprint is correct
X4 The default behaviour is for keyprint to output the postscript to
XSTDOUT, but you can change that (around line 40)
X4 Run it: 'keyprint | lpr', or 'keyprint <username> | lpr'
X
XThere are _lots_ of features and command-line options I want to add to
Xthis program, but I haven't got around to it yet.
X
XLet me know if you have hassles.
Xrik.
X--
XThe Fulcrum Consulting Group o
X------------------------------------------------------------------------------
XRik Harris - rik.harris@fulcrum.com.au +61 3 621-2100 (BH) /\
X12th Floor, 10-16 Queen St. Melbourne VIC 3000. +61 3 621-2724 (Fax)
SHAR_EOF
true || echo 'restore of README failed'
fi
# ============= keyblank.ps ==============
if test -f 'keyblank.ps' -a X"$1" != X"-c"; then
echo 'x - skipping keyblank.ps (File already exists)'
else
echo 'x - extracting keyblank.ps (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'keyblank.ps' &&
X%!
X%%BoundingBox: (atend)
X%%Pages: (atend)
X%%DocumentFonts: (atend)
X%%EndComments
X%%BeginProlog
X%
X% FrameMaker postscript_prolog 3.0, for use with FrameMaker 3.0
X% This postscript_prolog file is Copyright (c) 1986-1991 Frame Technology
X% Corporation. All rights reserved. This postscript_prolog file may be
X% freely copied and distributed in conjunction with documents created using
X% FrameMaker.
X%
X% Known Problems:
X% Due to bugs in Transcript, the 'PS-Adobe-' is omitted from line 1
X/FMversion (3.0) def
X% Set up Color vs. Black-and-White
X
X/FMPrintInColor { % once-thru loop gimmick
X % See if we're a NeWSprint printer
X /currentcanvas where {
X pop currentcanvas /Color known {
X currentcanvas /Color get
X exit
X } if
X } if
X systemdict /colorimage known
X systemdict /currentcolortransfer known and
Xexit } loop def
X
X% Uncomment this line to force b&w on color printer
X% /FMPrintInColor false def
X/FrameDict 195 dict def
Xsystemdict /errordict known not {/errordict 10 dict def
X errordict /rangecheck {stop} put} if
X% The readline in 23.0 doesn't recognize cr's as nl's on AppleTalk
XFrameDict /tmprangecheck errordict /rangecheck get put
Xerrordict /rangecheck {FrameDict /bug true put} put
XFrameDict /bug false put
Xmark
X% Some PS machines read past the CR, so keep the following 3 lines together!
Xcurrentfile 5 string readline
X00
X0000000000
Xcleartomark
Xerrordict /rangecheck FrameDict /tmprangecheck get put
XFrameDict /bug get {
X /readline {
X /gstring exch def
X /gfile exch def
X /gindex 0 def
X {
X gfile read pop
X dup 10 eq {exit} if
X dup 13 eq {exit} if
X gstring exch gindex exch put
X /gindex gindex 1 add def
X } loop
X pop
X gstring 0 gindex getinterval true
X } def
X } if
X/FMVERSION {
X FMversion ne {
X /Times-Roman findfont 18 scalefont setfont
X 100 100 moveto
X (FrameMaker version does not match postscript_prolog!)
X dup =
X show showpage
X } if
X } def
X/FMLOCAL {
X FrameDict begin
X 0 def
X end
X } def
X /gstring FMLOCAL
X /gfile FMLOCAL
X /gindex FMLOCAL
X /orgxfer FMLOCAL
X /orgproc FMLOCAL
X /organgle FMLOCAL
X /orgfreq FMLOCAL
X /yscale FMLOCAL
X /xscale FMLOCAL
X /manualfeed FMLOCAL
X /paperheight FMLOCAL
X /paperwidth FMLOCAL
X/FMDOCUMENT {
X array /FMfonts exch def
X /#copies exch def
X FrameDict begin
X 0 ne dup {setmanualfeed} if
X /manualfeed exch def
X /paperheight exch def
X /paperwidth exch def
X /yscale exch def
X /xscale exch def
X currenttransfer cvlit /orgxfer exch def
X currentscreen cvlit /orgproc exch def
X /organgle exch def /orgfreq exch def
X setpapername
X manualfeed {true} {papersize} ifelse
X {manualpapersize} {false} ifelse
X {desperatepapersize} if
X end
X } def
X /pagesave FMLOCAL
X /orgmatrix FMLOCAL
X /landscape FMLOCAL
X/FMBEGINPAGE {
X FrameDict begin
X /pagesave save def
X 3.86 setmiterlimit
X /landscape exch 0 ne def
X landscape {
X 90 rotate 0 exch neg translate pop
X }
X {pop pop}
X ifelse
X xscale yscale scale
X /orgmatrix matrix def
X gsave
X } def
X/FMENDPAGE {
X grestore
X pagesave restore
X end
X showpage
X } def
X/FMFONTDEFINE {
X FrameDict begin
X findfont
X ReEncode
X 1 index exch
X definefont
X FMfonts 3 1 roll
X put
X end
X } def
X/FMFILLS {
X FrameDict begin
X array /fillvals exch def
X end
X } def
X/FMFILL {
X FrameDict begin
X fillvals 3 1 roll put
X end
X } def
X/FMNORMALIZEGRAPHICS {
X newpath
X 0.0 0.0 moveto
X 1 setlinewidth
X 0 setlinecap
X 0 0 0 sethsbcolor
X 0 setgray
X } bind def
X /fx FMLOCAL
X /fy FMLOCAL
X /fh FMLOCAL
X /fw FMLOCAL
X /llx FMLOCAL
X /lly FMLOCAL
X /urx FMLOCAL
X /ury FMLOCAL
X/FMBEGINEPSF {
X end
X /FMEPSF save def
X /showpage {} def
X FMNORMALIZEGRAPHICS
X [/fy /fx /fh /fw /ury /urx /lly /llx] {exch def} forall
X fx fy translate
X rotate
X fw urx llx sub div fh ury lly sub div scale
X llx neg lly neg translate
X } bind def
X/FMENDEPSF {
X FMEPSF restore
X FrameDict begin
X } bind def
XFrameDict begin
X/setmanualfeed {
X%%BeginFeature *ManualFeed True
X statusdict /manualfeed true put
X%%EndFeature
X } def
X/max {2 copy lt {exch} if pop} bind def
X/min {2 copy gt {exch} if pop} bind def
X/inch {72 mul} def
X/pagedimen {
X paperheight sub abs 16 lt exch
X paperwidth sub abs 16 lt and
X {/papername exch def} {pop} ifelse
X } def
X /papersizedict FMLOCAL
X/setpapername {
X /papersizedict 14 dict def
X papersizedict begin
X /papername /unknown def
X /Letter 8.5 inch 11.0 inch pagedimen
X /LetterSmall 7.68 inch 10.16 inch pagedimen
X /Tabloid 11.0 inch 17.0 inch pagedimen
X /Ledger 17.0 inch 11.0 inch pagedimen
X /Legal 8.5 inch 14.0 inch pagedimen
X /Statement 5.5 inch 8.5 inch pagedimen
X /Executive 7.5 inch 10.0 inch pagedimen
X /A3 11.69 inch 16.5 inch pagedimen
X /A4 8.26 inch 11.69 inch pagedimen
X /A4Small 7.47 inch 10.85 inch pagedimen
X /B4 10.125 inch 14.33 inch pagedimen
X /B5 7.16 inch 10.125 inch pagedimen
X end
X } def
X/papersize {
X papersizedict begin
X /Letter {lettertray letter} def
X /LetterSmall {lettertray lettersmall} def
X /Tabloid {11x17tray 11x17} def
X /Ledger {ledgertray ledger} def
X /Legal {legaltray legal} def
X /Statement {statementtray statement} def
X /Executive {executivetray executive} def
X /A3 {a3tray a3} def
X /A4 {a4tray a4} def
X /A4Small {a4tray a4small} def
X /B4 {b4tray b4} def
X /B5 {b5tray b5} def
X /unknown {unknown} def
X papersizedict dup papername known {papername} {/unknown} ifelse get
X end
X /FMdicttop countdictstack 1 add def
X statusdict begin stopped end
X countdictstack -1 FMdicttop {pop end} for
X } def
X/manualpapersize {
X papersizedict begin
X /Letter {letter} def
X /LetterSmall {lettersmall} def
X /Tabloid {11x17} def
X /Ledger {ledger} def
X /Legal {legal} def
X /Statement {statement} def
X /Executive {executive} def
X /A3 {a3} def
X /A4 {a4} def
X /A4Small {a4small} def
X /B4 {b4} def
X /B5 {b5} def
X /unknown {unknown} def
X papersizedict dup papername known {papername} {/unknown} ifelse get
X end
X stopped
X } def
X/desperatepapersize {
X statusdict /setpageparams known
X {
X paperwidth paperheight 0 1
X statusdict begin
X {setpageparams} stopped pop
X end
X } if
X } def
X/savematrix {
X orgmatrix currentmatrix pop
X } bind def
X/restorematrix {
X orgmatrix setmatrix
X } bind def
X/dmatrix matrix def
X/dpi 72 0 dmatrix defaultmatrix dtransform
X dup mul exch dup mul add sqrt def
X/freq dpi 18.75 div 8 div round dup 0 eq {pop 1} if 8 mul dpi exch div def
X/sangle 1 0 dmatrix defaultmatrix dtransform exch atan def
X/DiacriticEncoding [
X/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
X/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
X/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
X/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
X/.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl
X/numbersign /dollar /percent /ampersand /quotesingle /parenleft
X/parenright /asterisk /plus /comma /hyphen /period /slash /zero /one
X/two /three /four /five /six /seven /eight /nine /colon /semicolon
X/less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K
X/L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash
X/bracketright /asciicircum /underscore /grave /a /b /c /d /e /f /g /h
X/i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar
X/braceright /asciitilde /.notdef /Adieresis /Aring /Ccedilla /Eacute
X/Ntilde /Odieresis /Udieresis /aacute /agrave /acircumflex /adieresis
X/atilde /aring /ccedilla /eacute /egrave /ecircumflex /edieresis
X/iacute /igrave /icircumflex /idieresis /ntilde /oacute /ograve
X/ocircumflex /odieresis /otilde /uacute /ugrave /ucircumflex
X/udieresis /dagger /.notdef /cent /sterling /section /bullet
X/paragraph /germandbls /registered /copyright /trademark /acute
X/dieresis /.notdef /AE /Oslash /.notdef /.notdef /.notdef /.notdef
X/yen /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
X/ordfeminine /ordmasculine /.notdef /ae /oslash /questiondown
X/exclamdown /logicalnot /.notdef /florin /.notdef /.notdef
X/guillemotleft /guillemotright /ellipsis /.notdef /Agrave /Atilde
X/Otilde /OE /oe /endash /emdash /quotedblleft /quotedblright
X/quoteleft /quoteright /.notdef /.notdef /ydieresis /Ydieresis
X/fraction /currency /guilsinglleft /guilsinglright /fi /fl /daggerdbl
X/periodcentered /quotesinglbase /quotedblbase /perthousand
X/Acircumflex /Ecircumflex /Aacute /Edieresis /Egrave /Iacute
X/Icircumflex /Idieresis /Igrave /Oacute /Ocircumflex /.notdef /Ograve
X/Uacute /Ucircumflex /Ugrave /dotlessi /circumflex /tilde /macron
X/breve /dotaccent /ring /cedilla /hungarumlaut /ogonek /caron
X] def
X/ReEncode {
X dup
X length
X dict begin
X {
X 1 index /FID ne
X {def}
X {pop pop} ifelse
X } forall
X 0 eq {/Encoding DiacriticEncoding def} if
X currentdict
X end
X } bind def
X/graymode true def
X /bwidth FMLOCAL
X /bpside FMLOCAL
X /bstring FMLOCAL
X /onbits FMLOCAL
X /offbits FMLOCAL
X /xindex FMLOCAL
X /yindex FMLOCAL
X /x FMLOCAL
X /y FMLOCAL
X/setpattern {
X /bwidth exch def
X /bpside exch def
X /bstring exch def
X /onbits 0 def /offbits 0 def
X freq sangle landscape {90 add} if
X {/y exch def
X /x exch def
X /xindex x 1 add 2 div bpside mul cvi def
X /yindex y 1 add 2 div bpside mul cvi def
X bstring yindex bwidth mul xindex 8 idiv add get
X 1 7 xindex 8 mod sub bitshift and 0 ne
X {/onbits onbits 1 add def 1}
X {/offbits offbits 1 add def 0}
X ifelse
X }
X setscreen
X {} settransfer
X offbits offbits onbits add div FMsetgray
X /graymode false def
X } bind def
X/grayness {
X FMsetgray
X graymode not {
X /graymode true def
X orgxfer cvx settransfer
X orgfreq organgle orgproc cvx setscreen
X } if
X } bind def
X /HUE FMLOCAL
X /SAT FMLOCAL
X /BRIGHT FMLOCAL
X /Colors FMLOCAL
XFMPrintInColor
X
X {
X /HUE 0 def
X /SAT 0 def
X /BRIGHT 0 def
X % array of arrays Hue and Sat values for the separations [HUE BRIGHT]
X /Colors
X [[0 0 ] % black
X [0 0 ] % white
X [0.00 1.0] % red
X [0.37 1.0] % green
X [0.60 1.0] % blue
X [0.50 1.0] % cyan
X [0.83 1.0] % magenta
X [0.16 1.0] % comment / yellow
X ] def
X
X /BEGINBITMAPCOLOR {
X BITMAPCOLOR} def
X /BEGINBITMAPCOLORc {
X BITMAPCOLORc} def
X /BEGINBITMAPTRUECOLOR {
X BITMAPTRUECOLOR } def
X /BEGINBITMAPTRUECOLORc {
X BITMAPTRUECOLORc } def
X /K {
X Colors exch get dup
X 0 get /HUE exch store
X 1 get /BRIGHT exch store
X HUE 0 eq BRIGHT 0 eq and
X {1.0 SAT sub setgray}
X {HUE SAT BRIGHT sethsbcolor}
X ifelse
X } def
X /FMsetgray {
X /SAT exch 1.0 exch sub store
X HUE 0 eq BRIGHT 0 eq and
X {1.0 SAT sub setgray}
X {HUE SAT BRIGHT sethsbcolor}
X ifelse
X } bind def
X }
X
X {
X /BEGINBITMAPCOLOR {
X BITMAPGRAY} def
X /BEGINBITMAPCOLORc {
X BITMAPGRAYc} def
X /BEGINBITMAPTRUECOLOR {
X BITMAPTRUEGRAY } def
X /BEGINBITMAPTRUECOLORc {
X BITMAPTRUEGRAYc } def
X /FMsetgray {setgray} bind def
X /K {
X pop
X } def
X }
Xifelse
X/normalize {
X transform round exch round exch itransform
X } bind def
X/dnormalize {
X dtransform round exch round exch idtransform
X } bind def
X/lnormalize {
X 0 dtransform exch cvi 2 idiv 2 mul 1 add exch idtransform pop
X } bind def
X/H {
X lnormalize setlinewidth
X } bind def
X/Z {
X setlinecap
X } bind def
X /fillvals FMLOCAL
X/X {
X fillvals exch get
X dup type /stringtype eq
X {8 1 setpattern}
X {grayness}
X ifelse
X } bind def
X/V {
X gsave eofill grestore
X } bind def
X/N {
X stroke
X } bind def
X/M {newpath moveto} bind def
X/E {lineto} bind def
X/D {curveto} bind def
X/O {closepath} bind def
X /n FMLOCAL
X/L {
X /n exch def
X newpath
X normalize
X moveto
X 2 1 n {pop normalize lineto} for
X } bind def
X/Y {
X L
X closepath
X } bind def
X /x1 FMLOCAL
X /x2 FMLOCAL
X /y1 FMLOCAL
X /y2 FMLOCAL
X /rad FMLOCAL
X/R {
X /y2 exch def
X /x2 exch def
X /y1 exch def
X /x1 exch def
X x1 y1
X x2 y1
X x2 y2
X x1 y2
X 4 Y
X } bind def
X/RR {
X /rad exch def
X normalize
X /y2 exch def
X /x2 exch def
X normalize
X /y1 exch def
X /x1 exch def
X newpath
X x1 y1 rad add moveto
X x1 y2 x2 y2 rad arcto
X x2 y2 x2 y1 rad arcto
X x2 y1 x1 y1 rad arcto
X x1 y1 x1 y2 rad arcto
X closepath
X 16 {pop} repeat
X } bind def
X/C {
X grestore
X gsave
X R
X clip
X } bind def
X /FMpointsize FMLOCAL
X/F {
X FMfonts exch get
X FMpointsize scalefont
X setfont
X } bind def
X/Q {
X /FMpointsize exch def
X F
X } bind def
X/T {
X moveto show
X } bind def
X/RF {
X rotate
X 0 ne {-1 1 scale} if
X } bind def
X/TF {
X gsave
X moveto
X RF
X show
X grestore
X } bind def
X/P {
X moveto
X 0 32 3 2 roll widthshow
X } bind def
X/PF {
X gsave
X moveto
X RF
X 0 32 3 2 roll widthshow
X grestore
X } bind def
X/S {
X moveto
X 0 exch ashow
X } bind def
X/SF {
X gsave
X moveto
X RF
X 0 exch ashow
X grestore
X } bind def
X/B {
X moveto
X 0 32 4 2 roll 0 exch awidthshow
X } bind def
X/BF {
X gsave
X moveto
X RF
X 0 32 4 2 roll 0 exch awidthshow
X grestore
X } bind def
X/G {
X gsave
X newpath
X normalize translate 0.0 0.0 moveto
X dnormalize scale
X 0.0 0.0 1.0 5 3 roll arc
X closepath fill
X grestore
X } bind def
X/A {
X gsave
X savematrix
X newpath
X 2 index 2 div add exch 3 index 2 div sub exch
X normalize 2 index 2 div sub exch 3 index 2 div add exch
X translate
X scale
X 0.0 0.0 1.0 5 3 roll arc
X restorematrix
X stroke
X grestore
X } bind def
X /x FMLOCAL
X /y FMLOCAL
X /w FMLOCAL
X /h FMLOCAL
X /xx FMLOCAL
X /yy FMLOCAL
X /ww FMLOCAL
X /hh FMLOCAL
X /FMsaveobject FMLOCAL
X /FMoptop FMLOCAL
X /FMdicttop FMLOCAL
X/BEGINPRINTCODE {
X /FMdicttop countdictstack 1 add def
X /FMoptop count 4 sub def
X /FMsaveobject save def
X userdict begin
X /showpage {} def
X FMNORMALIZEGRAPHICS
X 3 index neg 3 index neg translate
X } bind def
X/ENDPRINTCODE {
X count -1 FMoptop {pop pop} for
X countdictstack -1 FMdicttop {pop end} for
X FMsaveobject restore
X } bind def
X/gn {
X 0
X { 46 mul
X cf read pop
X 32 sub
X dup 46 lt {exit} if
X 46 sub add
X } loop
X add
X } bind def
X /str FMLOCAL
X/cfs {
X /str sl string def
X 0 1 sl 1 sub {str exch val put} for
X str def
X } bind def
X/ic [
X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0223
X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0223
X 0
X {0 hx} {1 hx} {2 hx} {3 hx} {4 hx} {5 hx} {6 hx} {7 hx} {8 hx} {9 hx}
X {10 hx} {11 hx} {12 hx} {13 hx} {14 hx} {15 hx} {16 hx} {17 hx} {18 hx}
X {19 hx} {gn hx} {0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12}
X {13} {14} {15} {16} {17} {18} {19} {gn} {0 wh} {1 wh} {2 wh} {3 wh}
X {4 wh} {5 wh} {6 wh} {7 wh} {8 wh} {9 wh} {10 wh} {11 wh} {12 wh}
X {13 wh} {14 wh} {gn wh} {0 bl} {1 bl} {2 bl} {3 bl} {4 bl} {5 bl} {6 bl
X}
X {7 bl} {8 bl} {9 bl} {10 bl} {11 bl} {12 bl} {13 bl} {14 bl} {gn bl}
X {0 fl} {1 fl} {2 fl} {3 fl} {4 fl} {5 fl} {6 fl} {7 fl} {8 fl} {9 fl}
X {10 fl} {11 fl} {12 fl} {13 fl} {14 fl} {gn fl}
X ] def
X /sl FMLOCAL
X /val FMLOCAL
X /ws FMLOCAL
X /im FMLOCAL
X /bs FMLOCAL
X /cs FMLOCAL
X /len FMLOCAL
X /pos FMLOCAL
X/ms {
X /sl exch def
X /val 255 def
X /ws cfs
X /im cfs
X /val 0 def
X /bs cfs
X /cs cfs
X } bind def
X400 ms
X/ip {
X is
X 0
X cf cs readline pop
X { ic exch get exec
X add
X } forall
X pop
X
X } bind def
X/wh {
X /len exch def
X /pos exch def
X ws 0 len getinterval im pos len getinterval copy pop
X pos len
X } bind def
X/bl {
X /len exch def
X /pos exch def
X bs 0 len getinterval im pos len getinterval copy pop
X pos len
X } bind def
X/s1 1 string def
X/fl {
X /len exch def
X /pos exch def
X /val cf s1 readhexstring pop 0 get def
X pos 1 pos len add 1 sub {im exch val put} for
X pos len
X } bind def
X/hx {
X 3 copy getinterval
X cf exch readhexstring pop pop
X } bind def
X /h FMLOCAL
X /w FMLOCAL
X /d FMLOCAL
X /lb FMLOCAL
X /bitmapsave FMLOCAL
X /is FMLOCAL
X /cf FMLOCAL
X/wbytes {
X dup
X 8 eq {pop} {1 eq {7 add 8 idiv} {3 add 4 idiv} ifelse} ifelse
X } bind def
X/BEGINBITMAPBWc {
X 1 {} COMMONBITMAPc
X } bind def
X/BEGINBITMAPGRAYc {
X 8 {} COMMONBITMAPc
X } bind def
X/BEGINBITMAP2BITc {
X 2 {} COMMONBITMAPc
X } bind def
X/COMMONBITMAPc {
X /r exch def
X /d exch def
X gsave
X translate rotate scale /h exch def /w exch def
X /lb w d wbytes def
X sl lb lt {lb ms} if
X /bitmapsave save def
X r
X /is im 0 lb getinterval def
X ws 0 lb getinterval is copy pop
X /cf currentfile def
X w h d [w 0 0 h neg 0 h]
X {ip} image
X bitmapsave restore
X grestore
X } bind def
X/BEGINBITMAPBW {
X 1 {} COMMONBITMAP
X } bind def
X/BEGINBITMAPGRAY {
X 8 {} COMMONBITMAP
X } bind def
X/BEGINBITMAP2BIT {
X 2 {} COMMONBITMAP
X } bind def
X/COMMONBITMAP {
X /r exch def
X /d exch def
X gsave
X translate rotate scale /h exch def /w exch def
X /bitmapsave save def
X r
X /is w d wbytes string def
X /cf currentfile def
X w h d [w 0 0 h neg 0 h]
X {cf is readhexstring pop} image
X bitmapsave restore
X grestore
X } bind def
X /proc1 FMLOCAL
X /proc2 FMLOCAL
X /newproc FMLOCAL
X/Fmcc {
X /proc2 exch cvlit def
X /proc1 exch cvlit def
X /newproc proc1 length proc2 length add array def
X newproc 0 proc1 putinterval
X newproc proc1 length proc2 putinterval
X newproc cvx
X} bind def
X/ngrayt 256 array def
X/nredt 256 array def
X/nbluet 256 array def
X/ngreent 256 array def
X /gryt FMLOCAL
X /blut FMLOCAL
X /grnt FMLOCAL
X /redt FMLOCAL
X /indx FMLOCAL
X /cynu FMLOCAL
X /magu FMLOCAL
X /yelu FMLOCAL
X /k FMLOCAL
X /u FMLOCAL
X/colorsetup {
X currentcolortransfer
X /gryt exch def
X /blut exch def
X /grnt exch def
X /redt exch def
X 0 1 255 {
X /indx exch def
X /cynu 1 red indx get 255 div sub def
X /magu 1 green indx get 255 div sub def
X /yelu 1 blue indx get 255 div sub def
X /k cynu magu min yelu min def
X /u k currentundercolorremoval exec def
X nredt indx 1 0 cynu u sub max sub redt exec put
X ngreent indx 1 0 magu u sub max sub grnt exec put
X nbluet indx 1 0 yelu u sub max sub blut exec put
X ngrayt indx 1 k currentblackgeneration exec sub gryt exec put
X } for
X {255 mul cvi nredt exch get}
X {255 mul cvi ngreent exch get}
X {255 mul cvi nbluet exch get}
X {255 mul cvi ngrayt exch get}
X setcolortransfer
X {pop 0} setundercolorremoval
X {} setblackgeneration
X } bind def
X /tran FMLOCAL
X/fakecolorsetup {
X /tran 256 string def
X 0 1 255 {/indx exch def
X tran indx
X red indx get 77 mul
X green indx get 151 mul
X blue indx get 28 mul
X add add 256 idiv put} for
X currenttransfer
X {255 mul cvi tran exch get 255.0 div}
X exch Fmcc settransfer
X} bind def
X/BITMAPCOLOR {
X /d 8 def
X gsave
X translate rotate scale /h exch def /w exch def
X /bitmapsave save def
X colorsetup
X /is w d wbytes string def
X /cf currentfile def
X w h d [w 0 0 h neg 0 h]
X {cf is readhexstring pop} {is} {is} true 3 colorimage
X bitmapsave restore
X grestore
X } bind def
X/BITMAPCOLORc {
X /d 8 def
X gsave
X translate rotate scale /h exch def /w exch def
X /lb w d wbytes def
X sl lb lt {lb ms} if
X /bitmapsave save def
X colorsetup
X /is im 0 lb getinterval def
X ws 0 lb getinterval is copy pop
X /cf currentfile def
X w h d [w 0 0 h neg 0 h]
X {ip} {is} {is} true 3 colorimage
X bitmapsave restore
X grestore
X } bind def
X/BITMAPTRUECOLORc {
X gsave
X translate rotate scale /h exch def /w exch def
X /bitmapsave save def
X
X /is w string def
X
X ws 0 w getinterval is copy pop
X /cf currentfile def
X w h 8 [w 0 0 h neg 0 h]
X {ip} {gip} {bip} true 3 colorimage
X bitmapsave restore
X grestore
X } bind def
X/BITMAPTRUECOLOR {
X gsave
X translate rotate scale /h exch def /w exch def
X /bitmapsave save def
X /is w string def
X /gis w string def
X /bis w string def
X /cf currentfile def
X w h 8 [w 0 0 h neg 0 h]
X { cf is readhexstring pop }
X { cf gis readhexstring pop }
X { cf bis readhexstring pop }
X true 3 colorimage
X bitmapsave restore
X grestore
X } bind def
X/BITMAPTRUEGRAYc {
X gsave
X translate rotate scale /h exch def /w exch def
X /bitmapsave save def
X
X /is w string def
X
X ws 0 w getinterval is copy pop
X /cf currentfile def
X w h 8 [w 0 0 h neg 0 h]
X {ip gip bip w gray} image
X bitmapsave restore
X grestore
X } bind def
X/ww FMLOCAL
X/r FMLOCAL
X/g FMLOCAL
X/b FMLOCAL
X/i FMLOCAL
X/gray {
X /ww exch def
X /b exch def
X /g exch def
X /r exch def
X 0 1 ww 1 sub { /i exch def r i get .299 mul g i get .587 mul
X b i get .114 mul add add r i 3 -1 roll floor cvi put }
Xfor
X r
X } bind def
X/BITMAPTRUEGRAY {
X gsave
X translate rotate scale /h exch def /w exch def
X /bitmapsave save def
X /is w string def
X /gis w string def
X /bis w string def
X /cf currentfile def
X w h 8 [w 0 0 h neg 0 h]
X { cf is readhexstring pop
X cf gis readhexstring pop
X cf bis readhexstring pop w gray} image
X bitmapsave restore
X grestore
X } bind def
X/BITMAPGRAY {
X 8 {fakecolorsetup} COMMONBITMAP
X } bind def
X/BITMAPGRAYc {
X 8 {fakecolorsetup} COMMONBITMAPc
X } bind def
X/ENDBITMAP {
X } bind def
Xend
X /ALDsave FMLOCAL
X /ALDmatrix matrix def ALDmatrix currentmatrix pop
X/StartALD {
X /ALDsave save def
X savematrix
X ALDmatrix setmatrix
X } bind def
X/InALD {
X restorematrix
X } bind def
X/DoneALD {
X ALDsave restore
X } bind def
X%%EndProlog
X%%BeginSetup
X(3.0) FMVERSION
X1 1 595.3 841.9 0 1 2 FMDOCUMENT
X0 0 /AvantGarde-Demi FMFONTDEFINE
X1 0 /Helvetica FMFONTDEFINE
X32 FMFILLS
X0 0 FMFILL
X1 0.1 FMFILL
X2 0.3 FMFILL
X3 0.5 FMFILL
X4 0.7 FMFILL
X5 0.9 FMFILL
X6 0.97 FMFILL
X7 1 FMFILL
X8 <0f1e3c78f0e1c387> FMFILL
X9 <0f87c3e1f0783c1e> FMFILL
X10 <cccccccccccccccc> FMFILL
X11 <ffff0000ffff0000> FMFILL
X12 <8142241818244281> FMFILL
X13 <03060c183060c081> FMFILL
X14 <8040201008040201> FMFILL
X16 1 FMFILL
X17 0.9 FMFILL
X18 0.7 FMFILL
X19 0.5 FMFILL
X20 0.3 FMFILL
X21 0.1 FMFILL
X22 0.03 FMFILL
X23 0 FMFILL
X24 <f0e1c3870f1e3c78> FMFILL
X25 <f0783c1e0f87c3e1> FMFILL
X26 <3333333333333333> FMFILL
X27 <0000ffff0000ffff> FMFILL
X28 <7ebddbe7e7dbbd7e> FMFILL
X29 <fcf9f3e7cf9f3f7e> FMFILL
X30 <7fbfdfeff7fbfdfe> FMFILL
X%%EndSetup
X%%Page: "1" 1
X%%BeginPaperSize: A4
X%%EndPaperSize
X595.3 841.9 0 FMBEGINPAGE
X0 8 Q
X0 X
X0 K
X4 (USERNAME) 261.01 763.34 S
X1 5 Q
X(1:) 183.85 756.94 T
X(26:) 302.65 756.94 T
X(2:) 183.85 750.84 T
X(27:) 302.65 750.84 T
X(3:) 183.85 744.74 T
X(28:) 302.65 744.74 T
X(4:) 183.85 738.64 T
X(29:) 302.65 738.64 T
X(5:) 183.85 732.54 T
X(30:) 302.65 732.54 T
X(6:) 183.85 726.44 T
X(31:) 302.65 726.44 T
X(7:) 183.85 720.34 T
X(32:) 302.65 720.34 T
X(8:) 183.85 714.24 T
X(33:) 302.65 714.24 T
X(9:) 183.85 708.14 T
X(34:) 302.65 708.14 T
X(10:) 183.85 702.04 T
X(35:) 302.65 702.04 T
X(11:) 183.85 695.94 T
X(36:) 302.65 695.94 T
X(12:) 183.85 689.84 T
X(37:) 302.65 689.84 T
X(13:) 183.85 683.74 T
X(38:) 302.65 683.74 T
X(14:) 183.85 677.64 T
X(39:) 302.65 677.64 T
X(15:) 183.85 671.54 T
X(40:) 302.65 671.54 T
X(16:) 183.85 665.44 T
X(41:) 302.65 665.44 T
X(17:) 183.85 659.34 T
X(42:) 302.65 659.34 T
X(18:) 183.85 653.24 T
X(43:) 302.65 653.24 T
X(19:) 183.85 647.14 T
X(44:) 302.65 647.14 T
X(20:) 183.85 641.04 T
X(45:) 302.65 641.04 T
X(21:) 183.85 634.94 T
X(46:) 302.65 634.94 T
X(22:) 183.85 628.84 T
X(47:) 302.65 628.84 T
X(23:) 183.85 622.74 T
X(48:) 302.65 622.74 T
X(24:) 183.85 616.64 T
X(49:) 302.65 616.64 T
X(25:) 183.85 610.54 T
X(50:) 302.65 610.54 T
X(51:) 183.85 600.44 T
X(76:) 302.65 600.44 T
X(52:) 183.85 594.34 T
X(77:) 302.65 594.34 T
X(53:) 183.85 588.24 T
X(78:) 302.65 588.24 T
X(54:) 183.85 582.14 T
X(79:) 302.65 582.14 T
X(55:) 183.85 576.04 T
X(80:) 302.65 576.04 T
X(56:) 183.85 569.94 T
X(81:) 302.65 569.94 T
X(57:) 183.85 563.84 T
X(82:) 302.65 563.84 T
X(58:) 183.85 557.74 T
X(83:) 302.65 557.74 T
X(59:) 183.85 551.64 T
X(84:) 302.65 551.64 T
X(60:) 183.85 545.54 T
X(85:) 302.65 545.54 T
X(61:) 183.85 539.44 T
X(86:) 302.65 539.44 T
X(62:) 183.85 533.34 T
X(87:) 302.65 533.34 T
X(63:) 183.85 527.24 T
X(88:) 302.65 527.24 T
X(64:) 183.85 521.14 T
X(89:) 302.65 521.14 T
X(65:) 183.85 515.04 T
X(90:) 302.65 515.04 T
X(66:) 183.85 508.94 T
X(91:) 302.65 508.94 T
X(67:) 183.85 502.84 T
X(92:) 302.65 502.84 T
X(68:) 183.85 496.74 T
X(93:) 302.65 496.74 T
X(69:) 183.85 490.64 T
X(94:) 302.65 490.64 T
X(70:) 183.85 484.54 T
X(95:) 302.65 484.54 T
X(71:) 183.85 478.44 T
X(96:) 302.65 478.44 T
X(72:) 183.85 472.34 T
X(97:) 302.65 472.34 T
X(73:) 183.85 466.24 T
X(98:) 302.65 466.24 T
X(74:) 183.85 460.14 T
X(99:) 302.65 460.14 T
X(75:) 183.85 454.04 T
X178.85 761.24 178.85 608.99 2 L
XV
X0.25 H
X0 Z
XN
X416.45 761.24 416.45 608.99 2 L
XV
XN
X178.72 761.37 416.57 761.37 2 L
XV
XN
X178.72 608.87 416.57 608.87 2 L
XV
XN
X178.85 604.74 178.85 452.5 2 L
XV
XN
X416.45 604.74 416.45 452.5 2 L
XV
XN
X178.72 604.87 416.57 604.87 2 L
XV
XN
X178.72 452.37 416.57 452.37 2 L
XV
XN
X171 445.9 423 769.9 R
X0.01 H
X2 Z
X13 X
XN
X163 606.9 433 606.9 2 L
XN
XFMENDPAGE
X%%EndPage: "1" 2
X%%Trailer
X%%BoundingBox: 0 0 595.3 841.9
X%%Pages: 1 1
X%%DocumentFonts: AvantGarde-Demi
X%%+ Helvetica
SHAR_EOF
true || echo 'restore of keyblank.ps failed'
fi
# ============= keyprint ==============
if test -f 'keyprint' -a X"$1" != X"-c"; then
echo 'x - skipping keyprint (File already exists)'
else
echo 'x - extracting keyprint (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'keyprint' &&
X#!/usr/local/bin/perl
X
X# Version 1
X#
X# Use this in whatever way you like, it's not worth copyrighting :-)
X
X$dir="/packages/skey";
X$psfile="$dir/keyblank.ps";
X$|=1;
X
X@ENV{'PATH'}='/usr/bin:/usr/ucb';
X
X$username=$ARGV[0] || `whoami`;
X$username =~ /(\w+)/;
X$username = $1;
X
Xopen(NAMES, "$dir/keyinfo $username|")
X || die "can't run keyinfo: $!, stopped";
X$key = <NAMES>;
X$key =~ /^\d+\s+(\w+)/
X || die "User $username not found. Make sure you have run keyinit, stopped";
X$key = $1;
Xclose(NAMES);
Xopen(KEYS, "$dir/key -n 99 99 $key|")
X || die "can't open $keyfile: $!, stopped";
Xopen(PS, "<$psfile") || die "can't open $psfile: $!, stopped";
X
X# yuck!
Xprint "Enter secret password:";
Xsystem("stty -echo");
X
Xwhile(<KEYS>)
X{
X /^(\d+):\s(.+)$/ && do { $key{$1}=$2; next; };
X};
X
X# more yuck!
Xsystem("stty echo");
Xprint "\n";
X
Xclose(KEYS);
X
X#open(PRINTER, "|lpr") || die "can't open printer: $!, stopped";
X#open(PRINTER, ">/tmp/test") || die "can't open /tmp/test: $!, stopped";
Xopen(PRINTER, ">-") || die "can't send output to STDOUT: $!, stopped";
X
Xwhile(<PS>)
X{
X s/USERNAME/$key/;
X s/^\((\d+):\)/($1: $key{$1})/;
X print PRINTER $_;
X}
SHAR_EOF
true || echo 'restore of keyprint failed'
fi
exit 0
--
The Fulcrum Consulting Group o
------------------------------------------------------------------------------
Rik Harris - rik.harris@fulcrum.com.au +61 3 621-2100 (BH) /\
12th Floor, 10-16 Queen St. Melbourne VIC 3000. +61 3 621-2724 (Fax)
Technical Details
Message-ID:
<2js31v$rbj@harbinger.cc.monash.edu.au>Path:
arc1-ca.pugleaf.net!wupost!math.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!msuinfo!harbinger.cc.monash.edu.au!alquist.rdt.monash.edu.au!rikShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!wupost!math.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!msuinfo!harbinger.cc.monash.edu.au!alquist.rdt.monash.edu.au!rik From: rik@alquist.rdt.monash.edu.au (Rik Harris) Newsgroups: comp.security.unix,alt.sources Subject: Keyprint: PostScript key printing program for S/Key Date: 16 Feb 1994 03:14:07 GMT Organization: Monash University Lines: 1321 Message-ID: <2js31v$rbj@harbinger.cc.monash.edu.au> Reply-To: rik.harris@fcit.monash.edu.au NNTP-Posting-Host: alquist.rdt.monash.edu.au