Chapter 6: Programming Examples
53
RC = S g l C r y p t L o c k ( PROD_ABC_ID ,
TEA_KEY_NUM ,
/ / number o f k e y
CRYPT_MODE_ENCRYPT,
/ /
e n c r y p t
1 ,
/ /
b l o c k
c o u n t
R a n S g l R e s u l t
) ;
/ /
4 .
s t e p : e n c r y p t
t h e random number i n t h e
p r o t e c t e d
/ /
a p p l i c a t i o n
S g l T e a E n c i p h e r ( RandomNumber , R a n A p p R e s u l t , TEA_key ) ;
/ /
5 . S t e p : c o m p a r e b o t h
r e s u l t s
i f ( (
R a n S g l R e s u l t [ 0 ] ! = R a n A p p R e s u l t [ 0 ] )
| |
( R a n S g l R e s u l t [ 1 ] ! = R a n A p p R e s u l t [ 1 ]
) ) {
/ /
a u t h e n t i c a t i o n
f a i l e d
! !
p r i n t f ( "SG
−
Lock Modul a u t h e n t i c a t i o n :
E r r o r ! \ n "
) ;
}
/ /
a u t h e n t i c a t i o n
s u c c e s s f u l
. . .
More programming examples and the necessary include files can be found on
the SG-Lock CD-ROM.
Summary of Contents for SG-Lock
Page 2: ......
Page 22: ......
Page 60: ......
Page 62: ...56 Chapter 7 Technical Data Notes ...
Page 63: ...Chapter 7 Technical Data 57 ...