Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    2,427

    How to detect succesful decryption.

    I'm working on a project to provide users with a quick and easy way to encrypt and decrypt a folder of files for use 'off-site' but I realised that the decryption process doesn't in itself provide any way to check for a successful decryption. If the password is incorrect the process goes ahead and produces 'rubbish'.

    At the moment I'm putting a check file in to the files waiting for encryption which gets encrypted along with the rest. After decryption I'm reading it back to a string and displaying the string in a label. The label either reads "Success" or "öÖßͽU)â-Q§pÂïôÚƒ" so it's obvious whether it has worked or not

    To say the least, it's not very elegant. Does anybody know of a better way to do it?

  2. #2
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    Perform a checksum calculation on the file and compare the result to a predetermined correct value.

    You can use either Crypto.MD5DigestFromFile or File.GetCRC to calculate the checksum.
    --[[ Indigo Rose Software Developer ]]

  3. #3
    Join Date
    Aug 2003
    Posts
    2,427
    Thanks for that Lorne.

Similar Threads

  1. Acrobat.det does not detect that Acrobat is not installed
    By mlupo in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 07-22-2005, 06:51 AM
  2. detect Acrobat Reader version dynamically
    By andrewr in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 05-20-2005, 08:24 AM
  3. Detect compressed .tif files
    By TJ_Tigger in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 07-22-2004, 02:57 PM
  4. Q with detect acrobat and reader
    By lorenhsu1128 in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 04-21-2004, 06:48 PM
  5. HOWTO: Detect Acrobat Version
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-22-2002, 04:01 PM

Posting Permissions

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