home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / hypercar / 4923 < prev    next >
Encoding:
Text File  |  1993-01-25  |  3.8 KB  |  106 lines

  1. Newsgroups: comp.sys.mac.hypercard
  2. Path: sparky!uunet!cs.utexas.edu!hellgate.utah.edu!lanl!davids
  3. From: davids@gardener.lanl.gov (David G. Simmons)
  4. Subject: Re: Hide text strings in a stack?
  5. Message-ID: <1993Jan25.154430.19460@newshost.lanl.gov>
  6. Originator: davids@feynman.lanl.gov
  7. Sender: news@newshost.lanl.gov
  8. Organization: Los Alamos National Laboratory
  9. References: <B0aoXB3w165w@bbs.draco.bison.mb.ca> <1BRRXB9w165w@bbs.draco.bison.mb.ca>
  10. Date: Mon, 25 Jan 1993 15:44:30 GMT
  11. Lines: 93
  12.  
  13.  
  14. In article <1BRRXB9w165w@bbs.draco.bison.mb.ca>, grub@bbs.draco.bison.mb.ca (Gordon Grieder) writes:
  15. |> 
  16. |>  In a message written on 19 Jan 93 22:42:28 GMT, broun@apple.com (Kevin 
  17. |>  Broun) writes:
  18. |> > 
  19. |> > I'm using the Mount XCMD to mount a password-protected AppleShare server
  20. |> > volume.  Can anybody out there recommend a relatively secure way to hide 
  21. |> > a
  22. |> > couple of short text strings (username & password) somewhere in a stack
  23. |> > (maybe encrypted somehow or in a resource), where they can be retrieved 
  24. |> > by
  25. |> > a script that would then call the Mount XCMD?
  26. |> >  
  27. |> > Just putting the strings in a script and using "Protect Stack" isn't
  28. |> > sufficient since many word processors can just open up the data fork of 
  29. |> > the
  30. |> > stack and see the scripts...  Thanks for your help!
  31. |> 
  32. |> a simple chaaracter shift system  should keep out most prying eyes;
  33. |> ie- A=C  B=D  C=E....
  34. |> 
  35. |> thus ECV=CAT
  36. |> 
  37. |> (or try using ROT-13 ;-)
  38. |> 
  39. |> 
  40. |> Keep in mind that no simple system such as this would keep out even a mildy
  41. |> skilled hack.  Hypercard wasn't designed with top-notch security in mind.
  42. |> 
  43.  
  44. I though that generating a random number to add into the mix would keep out
  45. most prying eyes, something like this (though it is not tested, and being
  46. made up right here on the spot...)
  47.  
  48. function encode  passwd
  49.   put random(50) into item 1 of passW
  50.   repeat with x = 1 to the number of chars in passwd
  51.      put numtochar(chartonum(char x of passwd) + item 1 of passW) into char x 
  52.     of item 2 of passW
  53.   end repeat
  54.   return passW
  55. end encode
  56.  
  57. function decode passwd
  58.   repeat with x = 1 to the number of chars in item 2 of passwd
  59.       put numtochar(chartonum(char x of item 2 of passwd) - item 2 of passwd)
  60.     into char x of item 2 of passwd
  61.   end repeat
  62.   return item 2 of passwd
  63. end decode
  64.  
  65. By using CompileIt! to compile these two functions into XFCNs (they are less
  66. than 10 lines each, so the FREE demo version of CompileIt! could be used),
  67. prying eyens would not be able to see the encoding, or decoding scheme used.
  68. even adding or subtracting a constant inside the function would obfuscate
  69. even further, since any pryer could only see the returned random value,
  70. and not the additional coinstant that would be needed to decode the password.
  71.  
  72. It might take some additional tweaking, so that the numtochar() function
  73. did not make the resultant character an impossible result for a char, but
  74. other than that, it *should* work.  Que no?
  75.  
  76. Then all you have to do is...
  77.  
  78. on EnterpassWord
  79.    ask password "Enter your passsord:"
  80.    if it is not empty then 
  81.       put it into temp
  82.       ask password "Once more for verification:"
  83.       if it = temp then put encode(it) into fld "StorePass"
  84.       else exit enterpassWord
  85.    end if
  86. end EnterpassWord
  87.  
  88. on exitPassword
  89.    ask password "Enter your Password:"
  90.    if it is not empty then put decode(it) into decoded
  91.    if decoded <> fld "storePass" then answer "Nice try Hack!"
  92. end exitPassword
  93.  
  94. Anyway, none of this is tested (it hasn't even been near a mac!), so your
  95. mileage will ceratinly vary.  I think it will work, and in fact am going
  96. over to add it to a stack I'm working on, and have been looking for a 
  97. "security system" for anyway.  I'll let you all kknow the results.
  98.  
  99.  
  100. -- 
  101. David G. Simmons    "New Mexico...Land of the flea,
  102. davids@lanl.gov      Home of the Plague..."
  103. -- 
  104. David G. Simmons    "New Mexico...Land of the flea,
  105. davids@lanl.gov      Home of the Plague..."
  106.