source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQHSH1.m@ 1663

Last change on this file since 1663 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 969 bytes
RevLine 
[613]1VAQHSH1 ;ALB/JRP - ENCRYPT/DECRYPT ROUTINES;29-MAR-93
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3KRNLHASH(STRING,KEY1,KEY2,DCRYPT) ;ENCRYPT/DECRYPT USING KERNEL HASHING
4 ;INPUT : STRING - String to encrypt/decrypt
5 ; KEY1 - Primary key for encryption/decryption (numeric)
6 ; (defaults to the current value in DUZ)
7 ; KEY2 - Secondary key for encryption/decryption (numeric)
8 ; (defaults to 0)
9 ; DCRYPT - Flag indicating whether to encrypt or decrypt
10 ; If 0, encrypt STRING (default)
11 ; If 1, decrypt STRING
12 ;OUTPUT : S - STRING encrypted/decrypted using KERNEL hashing
13 ; Null - Encryption/decryption not possible
14 ;
15 ;CHECK INPUT
16 Q:('$D(STRING)) ""
17 S:('$D(KEY1)) KEY1=+$G(DUZ)
18 S:(KEY1'?1.N) KEY1=+$G(DUZ)
19 S KEY2=+$G(KEY2)
20 S DCRYPT=+$G(DCRYPT)
21 ;DECLARE VARIABLES
22 N X,X1,X2
23 S X=STRING
24 S X1=KEY1
25 S X2=KEY2
26 ;ENCRYPT
27 I ('DCRYPT) D EN^XUSHSHP Q X
28 ;DECRYPT
29 D DE^XUSHSHP
30 Q X
Note: See TracBrowser for help on using the repository browser.