home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / BBS / PCBSEC20.ZIP / PCBSEC.PPE (.txt) < prev    next >
PCBoard Programming Language Executable  |  1995-01-15  |  5KB  |  327 lines

  1. ;------------------------------------------------------------------------------
  2. ;                                                   .ss.
  3. ;                                                   `²²'
  4. ;             .,sS$Ss,,s$  .,sS$$$Ss.  .,sS$Ss,,s$ .ss.  .sSs.
  5. ;           .d$$²^°²$$$$'.d$P²°^^²$P'.d$$²^°²$$$$'.$$$' .$$$²Sb,.
  6. ;           $$$'   .$$$' $$$²Sçsµ²' .$$$'   .$$$'.$$$' .$$$'  `$$b.
  7. ;           $$$b,,d$$$' ,$$$b,....,s$$$$b,,d$$$'.$$$;.,$$$'    ;$$$
  8. ;           `²S$$S²²S$$S²°²S$$$$S²°°²S$$$$$$',$$S²°²S$S'.sS$$$P²'
  9. ;                                    .sS²°$$$²²°"'       d²°'
  10. ;                                  .$$²  .$$'
  11. ;                                  $$$.,d$$'
  12. ;                                  `²S$$S²'
  13. ;------------------------------------------------------------------------------
  14. ; P.P.L.X. 2.OO                          (C)1996 - Lone Runner / AEGiS CoRP'96 
  15. ;------------------------------------------------------------------------------
  16. ; PPE 3.O1 (Encryption type I) - Analysis ON - Postprocessing ON
  17. ;------------------------------------------------------------------------------
  18.  
  19.     Boolean  BOOLEAN001
  20.     Date     DATE001
  21.     Date     DATE002
  22.     Integer  INTEGER001
  23.     Integer  INTEGER002
  24.     Integer  INTEGER003
  25.     Integer  INTEGER004
  26.     Integer  INTEGER005
  27.     Integer  INTEGER006
  28.     Integer  INTEGER007
  29.     Integer  INTEGER008
  30.     String   STRING001
  31.     String   STRING002
  32.     String   STRING003
  33.     String   STRING004
  34.     String   STRING005
  35.     String   STRING006
  36.     String   STRING007
  37.     String   STRING008
  38.     String   STRING009
  39.     String   STRING010
  40.     String   STRING011
  41.     String   STRING012
  42.     String   STRING013
  43.     String   STRING014
  44.     String   STRING015
  45.     String   STRING016
  46.     String   STRING017
  47.     String   STRING018
  48.     String   STRING019
  49.     String   STRING020
  50.     String   STRING021
  51.     String   STRING022
  52.     String   STRING023
  53.     String   STRING024
  54.     String   STRING025
  55.     String   STRING026
  56.     String   STRING027
  57.     String   STRING028
  58.  
  59. ;------------------------------------------------------------------------------
  60.  
  61.     STRING002 = PPEPath() + "CONFIG.SEC"
  62.     STRING005 = PPEPath() + "EXITMSG.SEC"
  63.     STRING007 = PPEPath() + "ONETIME.SEC"
  64.     STRING010 = PPEPath() + "PDATE.SEC"
  65.     STRING014 = PPEPath() + "ZIPPWDS.SEC"
  66.     STRING015 = PPEPath() + "PASSWORD.SEC"
  67.     STRING021 = PPEPath() + "TEMPMSG.SEC"
  68.     STRING025 = PPEPath() + "WELCOME.SEC"
  69.     STRING028 = PPEPath() + "ZNAME.SEC"
  70.     STRING006 = "Program modified... terminating for security reasons."
  71.     STRING016 = "Archive password WILL be visible to the SysOp!    "
  72.     STRING017 = "Archive password WILL NOT be visible to the SysOp!"
  73.     STRING019 = ""
  74.     FOpen 1, STRING002, 0, 0
  75.     If (Ferr(1)) Then
  76.         PrintLn "Error - CONFIG.SEC missing/corrupt - Exiting..."
  77.         Log "** Error - CONFIG.SEC missing/corrupt - PPE abandoned.", 1
  78.         End
  79.     Endif
  80.     FGet 1, STRING003
  81.     FGet 1, STRING018
  82.     FGet 1, STRING001
  83.     FGet 1, STRING020
  84.     FGet 1, BOOLEAN001
  85.     FGet 1, INTEGER003
  86.     FGet 1, STRING004
  87.     FClose 1
  88.     INTEGER004 = 0
  89.     INTEGER005 = 0
  90.     INTEGER006 = 0
  91.     For INTEGER008 = 1 To Len(STRING016)
  92.         INTEGER005 = INTEGER005 + Asc(Mid(STRING016, INTEGER008, 1))
  93.         INTEGER006 = INTEGER006 + Asc(Mid(STRING017, INTEGER008, 1))
  94.         INTEGER004 = (INTEGER005 + INTEGER006) / Len(STRING017)
  95.         INTEGER004 = XOr(INTEGER004, 256)
  96.     Next
  97.     If (((INTEGER004 <> 430) || (INTEGER005 <> 4293)) || (INTEGER006 <> 4438)) Then
  98.         PrintLn STRING006
  99.         End
  100.     Endif
  101.     If (Exist(STRING007)) Then
  102.         FOpen 1, STRING007, 2, 3
  103.         FGet 1, DATE002
  104.         Frewind 1
  105.         FPut 1, Date()
  106.         FClose 1
  107.     Else
  108.         FCreate 1, STRING007, 2, 3
  109.         FPut 1, Date()
  110.         DATE002 = Date()
  111.         FClose 1
  112.     Endif
  113.     If (Exist(STRING021)) Delete STRING021
  114.     If (DATE002 < Date()) Then
  115.         PrintLn "Standby... purging outdated files..."
  116.         FOpen 2, STRING010, 0, 3
  117.         FAppend 3, STRING021, 1, 3
  118.         :LABEL001
  119.         If (Ferr(2)) Goto LABEL003
  120.         FGet 2, STRING012
  121.         STRING011 = Left(STRING012, 12)
  122.         STRING013 = Right(STRING012, 8)
  123.         If (STRING013 < String(Date())) Then
  124.             If (Exist(STRING003 + STRING011)) Delete STRING003 + STRING011
  125.             Goto LABEL002
  126.         Endif
  127.         FPutLn 3, STRING012
  128.         :LABEL002
  129.         Goto LABEL001
  130.         :LABEL003
  131.         FClose 3
  132.         FClose 2
  133.         Delete STRING010
  134.         Rename STRING021, STRING010
  135.     Endif
  136.     FOpen 1, STRING028, 0, 0
  137.     If (Ferr(1)) Then
  138.         PrintLn "Error - ZNAME.SEC missing/corrupt - Exiting..."
  139.         Log "** Error - ZNAME.SEC missing/corrupt - PPE abandoned.", 1
  140.         End
  141.     Endif
  142.     FGet 1, STRING023
  143.     FClose 1
  144.     StartDisp 1
  145.     If (Exist(STRING025)) Then
  146.         DispFile STRING025, 1
  147.     Else
  148.         PrintLn "ASCII xmit or type message now... ESC will terminate entry."
  149.     Endif
  150.     PrintLn 
  151.     PrintLn "PCBSec - Encrypted E-Mail for PCBoard - Programmed by Madison Farrell, III"
  152.     PrintLn "Distributed Freely For The Use Of PCBoard SysOps -- 2.0"
  153.     PrintLn 
  154.     If (BOOLEAN001 == 1) Then
  155.         PrintLn STRING016
  156.     Else
  157.         PrintLn STRING017
  158.     Endif
  159.     Newline
  160.     FCreate 1, STRING020, 1, 3
  161.     While (INTEGER001 <> 27) Do
  162.         INTEGER001 = MGetByte()
  163.         STRING019 = STRING019 + Chr(INTEGER001)
  164.         Print Chr(INTEGER001)
  165.         If (INTEGER001 == 13) Then
  166.             PrintLn 
  167.             FPut 1, STRING019
  168.             STRING019 = ""
  169.         Endif
  170.         If (Len(STRING019) == 80) Then
  171.             FPut 1, STRING019
  172.             STRING019 = ""
  173.         Endif
  174.     EndWhile
  175.     FClose 1
  176.     If (Exist(STRING015)) DispFile STRING015, 1
  177.     While (STRING008 == "") Do
  178.         InputStr "password: _", STRING008, 14, 69, Mask_Pwd(), 64 + 1 + 2 + 4
  179.     EndWhile
  180.     STRING001 = STRING001 + STRING008 + " " + STRING003 + STRING023 + " " + STRING020
  181.     Shell 1, INTEGER002, STRING018, STRING001
  182.     INTEGER007 = S2I(STRING023, 10)
  183.     INTEGER007 = INTEGER007 + 1
  184.     If (INTEGER007 > 99999999) Then
  185.         INTEGER007 = 0
  186.     Endif
  187.     STRING024 = I2S(INTEGER007, 10)
  188.     If (Len(STRING024) < 8) Then
  189.         For INTEGER008 = 1 To 8 - Len(STRING024)
  190.             STRING027 = STRING027 + "0"
  191.         Next
  192.     Endif
  193.     STRING024 = STRING027 + STRING024
  194.     FCreate 1, STRING028, 1, 3
  195.     FPut 1, STRING024
  196.     FClose 1
  197.     FAppend 1, STRING010, 1, 3
  198.     STRING024 = STRING024 + "." + STRING004
  199.     INTEGER003 = String(INTEGER003)
  200.     DATE001 = Date() + INTEGER003
  201.     FPutLn 1, STRING024 + String(DATE001)
  202.     FClose 1
  203.     If (BOOLEAN001 == 1) Then
  204.         FAppend 1, STRING014, 1, 3
  205.         FPutLn 1, STRING023 + "." + STRING004 + " - " + STRING008
  206.         FClose 1
  207.     Endif
  208.     While (STRING022 == "") Do
  209.         InputStr "Message To: _", STRING022, 14, 20, Mask_Ascii(), 2 + 4 + 8
  210.     EndWhile
  211.     PrintLn 
  212.     STRING009 = STRING008
  213.     If (BOOLEAN001 == 0) Then
  214.         STRING026 = ""
  215.         While (STRING026 == "") Do
  216.             InputStr "Send password (Y/N): _", STRING026, 14, 1, "YyNn", 4 + 2 + 8
  217.             If (STRING026 == "N") STRING009 = "<NOT GIVEN FOR SECURITY REASONS>"
  218.         EndWhile
  219.     Endif
  220.     FCreate 1, STRING021, 1, 3
  221.     FPutLn 1, Chr(13)
  222.     FPutLn 1, "A secured message for you has been transmitted to the system."
  223.     FPutLn 1, "You may download the message as you would any other file."
  224.     FPutLn 1, Chr(13)
  225.     FPutLn 1, "The filname is: " + STRING023 + "." + STRING004
  226.     FPutLn 1, "This file will be deleted on: " + String(DATE001)
  227.     FPutLn 1, Chr(13)
  228.     FPutLn 1, "Decode password: " + STRING009
  229.     FPutLn 1, Chr(13)
  230.     FClose 1
  231.     Message CurConf(), STRING022, U_Name(), "Encrypted Message", "R", 0, 0, 0, STRING021
  232.     Delete STRING021
  233.     If (Exist(STRING005)) Then
  234.         DispFile STRING005, 1
  235.     Else
  236.         PrintLn "User notified..."
  237.     Endif
  238.     End
  239.  
  240. ;------------------------------------------------------------------------------
  241. ;
  242. ; Usage report (before postprocessing)
  243. ;
  244. ; ■ Statements used :
  245. ;
  246. ;    4       End
  247. ;    34      Goto 
  248. ;    44      Let 
  249. ;    1       Print 
  250. ;    14      PrintLn 
  251. ;    26      If 
  252. ;    3       DispFile 
  253. ;    4       FCreate 
  254. ;    4       FOpen 
  255. ;    3       FAppend 
  256. ;    11      FClose 
  257. ;    10      FGet 
  258. ;    5       FPut 
  259. ;    12      FPutLn 
  260. ;    1       StartDisp 
  261. ;    4       Delete 
  262. ;    2       Log 
  263. ;    3       InputStr 
  264. ;    1       Newline
  265. ;    1       Shell 
  266. ;    1       Message 
  267. ;    1       Rename 
  268. ;    1       Frewind 
  269. ;
  270. ;
  271. ; ■ Functions used :
  272. ;
  273. ;    1       /
  274. ;    46      +
  275. ;    2       -
  276. ;    9       ==
  277. ;    4       <>
  278. ;    5       <
  279. ;    2       <=
  280. ;    1       >
  281. ;    4       >=
  282. ;    22      !
  283. ;    4       &&
  284. ;    4       ||
  285. ;    7       Len(
  286. ;    2       Mid()
  287. ;    1       Left()
  288. ;    1       Right()
  289. ;    3       Ferr()
  290. ;    6       Chr()
  291. ;    2       Asc()
  292. ;    6       Date()
  293. ;    1       U_Name()
  294. ;    4       String()
  295. ;    1       Mask_Pwd()
  296. ;    1       Mask_Ascii()
  297. ;    1       CurConf()
  298. ;    9       PPEPath()
  299. ;    6       Exist()
  300. ;    1       I2S()
  301. ;    1       S2I()
  302. ;    1       XOr()
  303. ;    1       MGetByte()
  304. ;
  305. ;------------------------------------------------------------------------------
  306. ;
  307. ; Analysis flags : S
  308. ;
  309. ; S - Shell to DOS ■ 5
  310. ;     This may be normal if the PPE need to execute an external command,
  311. ;     but may be actually anything... nasty (formating HD, rebooting,...)
  312. ;     or usefull (sorting, maintenance,...). Check!
  313. ;     ■ Search for : SHELL
  314. ;
  315. ;------------------------------------------------------------------------------
  316. ;
  317. ; Postprocessing report
  318. ;
  319. ;    2       For/Next
  320. ;    4       While/EndWhile
  321. ;    15      If/Then or If/Then/Else
  322. ;    0       Select Case
  323. ;
  324. ;------------------------------------------------------------------------------
  325. ;                 AEGiS Corp - Break the routines, code against the machines!
  326. ;------------------------------------------------------------------------------
  327.