Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] FTP clip (was Save and retrieve some folder path values)

Expand Messages
  • Harvey R. Savage
    ... Hi Andy, I wrote a clip to encrypt/decrypt both the ftp1.ini and ftpscript.txt. My clip is below yours. It is written specifically for those files in the
    Message 1 of 10 , Sep 1, 2001
    • 0 Attachment
      Andy Young wrote:
      >
      > Hi,
      >
      > The FTP.ini file holds information about
      > IP addresses and logins and passwords. It's not secure.
      >
      > Hmm ... after looking things over, ftpscript.txt also contains the
      > logon information. Is there a way to leave the file but to delete
      > the information in it (ftpscript.txt) without opening and closing
      > it? Thanks
      >
      > Andy
      >
      Hi Andy,

      I wrote a clip to encrypt/decrypt both the ftp1.ini and
      ftpscript.txt. My clip is below yours. It is written
      specifically for those files in the locations you specified.
      Works NEAT, and quickly, you'll barely notice the 2 files loading
      and closing.

      I added 4 lines at the top of your clip and 4 lines at the
      bottom. I also separated you ^$GetValue()$ functions for easier
      reading, just a personal preference.

      When you run your clip you'll get a wizard at the start that
      gives you a preselected choice to decrypt the 2 files. The files
      should be encrypted before you run your clip. You'll get the
      same wizard at the end of your clip with a preselected choice to
      encrypt the 2 files. When your clip finishes both files will be
      in an encrypted, secure state.

      Last, there are 2 short clips at the bottom to encrypt a focused
      file before starting to use your modified clip. There is also a
      decrypt clip in case you need it.

      If you don't use these at least you might get some idea of
      another method.



      ---------< start 1st clip long lines separated by blank
      lines>---------
      H="Up Load File to Web Site"
      ;Andy Young <ajyoung@...>
      ;08/31/2001, 11:27:36 PM
      ^!ClearVariables
      ;
      ;added lines to decrypt ftp1.ini, ftpscript.txt
      ^!Set %p_decrypt%=_
      ^!Clip "encrypt/decrypt/all"
      ^!Set %p_decrypt%=^%Empty%
      ;
      ;declare the file that contains information
      ;Transfer information from file to variables in the clip
      ;
      ^!SetIniFile "^$GetAppPath$FTP1.ini"
      ^!Set %Computer%="^$GetValue("FTP:Computer")$"
      ^!Set %UserName%="^$GetValue("FTP:UserName")$"
      ^!Set %Password%="^$GetValue("FTP:Password")$"
      ^!Set %CaptureOutput%="^$GetValue("FTP:CaptureOutput")$"
      ^!Set %Command%="^$GetValue(FTP:Command)$"
      ^!Set %ScriptName%="^$GetValue("FTP:ScriptName")$"
      ;
      ^!SetIniFile
      ;
      ; get name and path of active document
      ^!Set %FileName%=^$GetDocName$
      ^!Set %LocalFolder%=^$GetPath(^%FileName%)$
      ;
      ; define document type, change to binary for images
      ^!Set %FileType%=ascii
      ;
      ;Adjust document directory to match website directory
      ^!Set %RemoteFolder%=^$StrReplace("D:\My
      Documents\WWWDEV\";"WWW";"^%LocalFolder%";False;False)$
      ;
      ^!Set
      %RemoteFolder%=^$StrReplace("\";"/";"^%RemoteFolder%";False;False)$
      ;
      ;adjust filename and path to lowercase to match server
      ^!Set %RemoteFolder%=^$StrLower(^%RemoteFolder%)$
      ;
      ;Send information to file for ftp.exe to read. This is a program
      ;came with windows
      ;
      ^!TextToFile "^%ScriptName%"
      open^%space%^%Computer%^%NL%^%UserName%^%NL%^%Password%^%NL%cd^%space%^%RemoteFolder%^%NL%^%FileType%^%NL%put^%space%^%FileName%^%NL%quit
      ;
      ;Send ftp command to ftp.exe and capture output
      ^!Set %Output%=^$GetOutput("^%Command%")$
      ;show results of ftp process
      ^!Info ^%Output%
      ;
      ;added lines to re-encrypt ftp1.ini, ftpscript.txt
      ^!Set %p_encrypt%=_
      ^!Clip "encrypt/decrypt/all"
      ^!Set %p_encrypt%=^%Empty%
      ;
      ^!ClearVariables
      ---------< end 1st clip >-----------


      I didn't need the ^!Delay's but added them just in case

      ---------< start 2nd clip long lines separated by blank
      lines>---------
      H="_encrypt/decrypt/all"
      ^!Goto ^?{Encrypt/Decrypt
      INI==^%p_decrypt%DECRYPT|^%p_encrypt%ENCRYPT|DON'T CHANGE^=END}
      ;
      :ENCRYPT
      ^!Open "^$GetAppPath$ftp1.ini"
      ;^!Delay 5
      ^!Select ALL
      ^$StrEncrypt("^$GetSelection$";)$
      ^!Close Save
      ;
      ^!Open "c:\ftpscript.txt"
      ;^!Delay 5
      ^!Select ALL
      ^$StrEncrypt("^$GetSelection$";)$
      ^!Close Save
      ;
      ^!Goto END
      ;
      :DECRYPT
      ^!Open "^$GetAppPath$ftp1.ini"
      ;^!Delay 5
      ^!Select ALL
      ^$StrDecrypt("^$GetSelection$";)$
      ^!Close Save
      ;
      ^!Open "c:\ftpscript.txt"
      ;^!Delay 5
      ^!Select ALL
      ^$StrDecrypt("^$GetSelection$";)$
      ^!Close Save
      :END
      ---------< end 2nd clip >-----------


      h="enc..."
      ^!Select ALL
      ^$StrEncrypt("^$GetSelection$";)$


      h="dec..."
      ^!Select ALL
      ^$StrDecrypt("^$GetSelection$";)$
    • thefrank
      I would like a few specific examples of why encrypted ftp.ini is important. What are the risks to not encrypt. Is this LAN related? Regards, tf
      Message 2 of 10 , Sep 2, 2001
      • 0 Attachment
        I would like a few specific examples of why encrypted ftp.ini is
        important. What are the risks to not encrypt. Is this LAN related?

        Regards,

        tf

        > > The FTP.ini file holds information about
        > > IP addresses and logins and passwords. It's not secure.
        > > Andy
      • Andy Young
        Hi, Harvey & Frank ... Thanks for the additional lines and work. I ve never wrote or worked with a clip that used NTP s encryption. I ll look the clip over and
        Message 3 of 10 , Sep 2, 2001
        • 0 Attachment
          Hi, Harvey & Frank

          > Harvey said,
          > I wrote a clip to encrypt/decrypt both the ftp1.ini and
          > ftpscript.txt.

          Thanks for the additional lines and work. I've never wrote or worked
          with a clip that used NTP's encryption. I'll look the clip over and
          read up some more. Children are home from college so I'm doing other
          things. Thanks again.

          > Frank said,
          > I would like a few specific examples of why encrypted ftp.ini is
          > important. What are the risks to not encrypt. Is this LAN related?

          I would assume if you share a computer or stay connected to a LAN
          you might want to use encryption, considering my FTP.ini contains
          usernames and passwords for several websites. I don't worry about it
          on my computer but I thought I'd mention that the clip was not
          secure. Some people are more concerned about that than others. And
          then I thought, why not try to make it more secure? Others who
          regularly use encryption might give more useful information.

          Andy
        Your message has been successfully submitted and would be delivered to recipients shortly.