Alpha Video Training
Results 1 to 6 of 6

Thread: Encrypt 3rd party files

  1. #1
    Member
    Real Name
    Walter
    Join Date
    Jun 2003
    Location
    South Africa
    Posts
    456

    Default Encrypt 3rd party files

    Hi,

    Is it possible to encrypt/decrypt a Excel file or MS Word file with a xbasic function?

    Thanks
    Have a nice day
    Walter

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Encrypt 3rd party files

    Give BASE64ENCODE() a try.

  3. #3
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Encrypt 3rd party files

    Create a word document in the c:\ root directory named secret.doc and try this in the interactive editor.


    Code:
    dim fp as P
    dim blob as B
    fp = file.open("C:\Secret.doc",FILE_RO_EXCLUSIVE)
    bts = fp.bytes_get()
    blob = fp.readb(bts)
    fp.close()
    
    enc = base64encode(blob)
    FILE.FROM_STRING("C:\encsecret.txt",enc)
    '-at this point examine the encsecret.txt file in the c:\ directory then close it.
    
    tst = file.to_string("C:\encsecret.txt")
    unenctst = base64decode(tst)
    
    uncsec = file.from_blob("C:\newsecret.doc",unenctst)
    '-now examine the newsecret.doc file

  4. #4
    Member
    Real Name
    Walter
    Join Date
    Jun 2003
    Location
    South Africa
    Posts
    456

    Default Re: Encrypt 3rd party files

    Hello Stan,

    This is working perfectly. Thanks for that.

    With my testing was I able to encrypt the file, but got lost on the decrypt.

    Many thanks for this code, I appreciate it!

    Regards
    Walter

  5. #5
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,693

    Default Re: Encrypt 3rd party files

    Base64 encoding is just that - encoding. It can be universally decoded without any type of key or passphrase, so it offers no encryption or security at all. The purpose of Base64 is simply to allow binary data to be transferred between systems without becoming corrupt.

    If you want to add security to the encrypted files, you should look at a5_encrypt_binary()

    Lenny Forziati
    Vice President, Internet Products and Technical Services
    Alpha Software Corporation

  6. #6
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,693

    Default Re: Encrypt 3rd party files

    Here's a prior thread with sample code: http://msgboard.alphasoftware.com/al...ad.php?t=69968

    Lenny Forziati
    Vice President, Internet Products and Technical Services
    Alpha Software Corporation

Similar Threads

  1. Which runtime files to use in 3rd party installation creator
    By georgefurnel in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 02-05-2009, 02:15 PM
  2. Do you use 3rd party Tools Poll
    By csda1 in forum Alpha Five Version 8
    Replies: 11
    Last Post: 09-27-2008, 02:37 AM
  3. 3rd party cookie trouble
    By RustyAuxier in forum Web Application Server v7
    Replies: 1
    Last Post: 04-26-2006, 05:08 PM
  4. 3rd party books for Alpha Five
    By Robert Messerly in forum Alpha Five Version 6
    Replies: 4
    Last Post: 03-13-2006, 10:12 PM
  5. 3rd Party Solutions
    By Ted Giles in forum Alpha Five Version 6
    Replies: 0
    Last Post: 03-11-2006, 04:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •