COMPILATION LISTING OF SEGMENT cmcs_scramble_ Compiled by: Multics PL/I Compiler, Release 31b, of April 24, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 05/24/89 1022.1 mst Wed Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) BULL HN Information Systems Inc., 1989 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1981 * 6* * * 7* *********************************************************** */ 8 9 10 11 12 /****^ HISTORY COMMENTS: 13* 1) change(89-04-23,Zimmerman), approve(89-04-23,MCR8060), 14* audit(89-05-05,RWaters), install(89-05-24,MR12.3-1048): 15* MCR8060 cmcs_scramble_.pl1 Reformatted code to new Cobol standard. 16* END HISTORY COMMENTS */ 17 18 19 /* Modified since Version 4.3 */ 20 21 /* format: style3 */ 22 cmcs_scramble_: 23 proc (arg) returns (char (10) aligned); 24 25 /* COBOL MCS subroutine directly adapted from the scramble_ routine in tools to handle 10 character passwords */ 26 27 /* Bob May, 6/30/77 */ 28 29 /* SCRAMBLE_ - Scramble a char (10) string. 30* 31* This procedure, given a password as input, returns a 10-character output string which: 32* 1. bears some relationship to the input 33* 2. loses some information - some passwords may scramble to the same value 34* 3. has no obvious relation to the input ("aaaaaaaa" and "aaaaaaab" 35* . scramble to noticeably different values.) 36* 37* Passwords stored in system files are scrambled, so that if anyone gets a dump 38* of the password file by accident, it won't do him much good. 39* 40* The transform is supposed to be non-invertible. 41* 42* A previous version of this program had two defects: 43* 1) It was invertible, as Steve Lipner demonstrated. 44* 2) It depended on double-precision MOD and MULTIPLY. These turned out 45* . to have been incorrectly implemented by PL/I and so the scramble, 46* . while good, would have given different values if the bugs were fixed. 47* 48* Method: 49* 1. strip the two high-order bits of each ASCII character, packing to the right. 50* 2. treat the resulting 70-bit quantity as both key and cipher text for 51* . the system enciphering program. 52* 3. destroy selected bits of the resulting cipher. 53* 54* Revised 5/21/73, THVV, for new algorithm. 55* THVV 10/30/71 56* */ 57 58 dcl arg char (10) aligned; 59 60 dcl temp char (10), 61 temp1 (1) fixed bin (71), 62 temp2 (1) fixed bin (71), 63 (p1, p2, p3) ptr, /* ptrs to based overlays */ 64 (i, k) fixed bin; 65 66 dcl bbt bit (72) aligned based (p1), 67 b72 bit (72) aligned based (p3), 68 bc10 char (10) aligned based (p3); 69 70 dcl 1 tsx based (p2) aligned, 71 2 pad bit (2) unal, 72 2 z (8) bit (7) unal; 73 74 dcl encipher_ entry (fixed bin (71), dim (*) fixed bin (71), dim (*) fixed bin (71), fixed bin); 75 76 dcl (addr, fixed, mod, substr) 77 builtin; 78 79 /* ------------------------------------------------------- */ 80 81 temp = arg; /* copy argument */ 82 p1 = addr (temp); 83 p2 = addr (temp1 (1)); 84 p3 = addr (temp2 (1)); 85 temp1 (1) = 0; 86 k = 1; 87 do i = 3 to 90 by 9; 88 z (k) = substr (bbt, i, 7); /* squeeze out always-zero bits */ 89 k = k + 1; 90 end; 91 temp = ""; /* Erase temporary copy */ 92 call encipher_ (temp1 (1), temp1, temp2, 1); /* Encipher the password. */ 93 temp1 (1) = 0; /* Tidy up */ 94 b72 = b72 & "111111110111111110111111110111111110111111110111111110111111110111111110"b; 95 return (bc10); 96 97 end /* cmcs_scramble_ */; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 05/24/89 0836.4 cmcs_scramble_.pl1 >spec>install>MR12.3-1048>cmcs_scramble_.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. addr builtin function dcl 76 ref 82 83 84 arg parameter char(10) dcl 58 ref 22 81 b72 based bit(72) dcl 66 set ref 94* 94 bbt based bit(72) dcl 66 ref 88 bc10 based char(10) dcl 66 ref 95 encipher_ 000010 constant entry external dcl 74 ref 92 i 000116 automatic fixed bin(17,0) dcl 60 set ref 87* 88* k 000117 automatic fixed bin(17,0) dcl 60 set ref 86* 88 89* 89 p1 000110 automatic pointer dcl 60 set ref 82* 88 p2 000112 automatic pointer dcl 60 set ref 83* 88 p3 000114 automatic pointer dcl 60 set ref 84* 94 94 95 substr builtin function dcl 76 ref 88 temp 000100 automatic char(10) packed unaligned dcl 60 set ref 81* 82 91* temp1 000104 automatic fixed bin(71,0) array dcl 60 set ref 83 85* 92* 92* 93* temp2 000106 automatic fixed bin(71,0) array dcl 60 set ref 84 92* tsx based structure level 1 dcl 70 z 0(02) based bit(7) array level 2 packed packed unaligned dcl 70 set ref 88* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. fixed builtin function dcl 76 mod builtin function dcl 76 NAME DECLARED BY EXPLICIT CONTEXT. cmcs_scramble_ 000020 constant entry external dcl 22 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 172 204 137 202 Length 350 137 12 127 33 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME cmcs_scramble_ 100 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME cmcs_scramble_ 000100 temp cmcs_scramble_ 000104 temp1 cmcs_scramble_ 000106 temp2 cmcs_scramble_ 000110 p1 cmcs_scramble_ 000112 p2 cmcs_scramble_ 000114 p3 cmcs_scramble_ 000116 i cmcs_scramble_ 000117 k cmcs_scramble_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc return_mac ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. encipher_ NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 22 000014 81 000025 82 000034 83 000036 84 000040 85 000042 86 000044 87 000046 88 000053 89 000063 90 000064 91 000067 92 000072 93 000120 94 000122 95 000126 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved