login about faq

The CkDecryptFile() member function of CkCrypt2 C++ class always return true even if the file is not encrypted.

CkDecryptFile always returns true even though "Sunset.jpg" is unencrypted file.

In my code, i would like to know if the file is unencrypted. One way of determining the file is unencrypted is CkDecryptFile() fails, but since CkDecryptFile() returns true i cannot determine whether file is unencrypted.

asked Aug 29 '12 at 16:04

chilkat's gravatar image

chilkat ♦♦

Symmetric encryption algorithms, such as AES, Blowfish, 3DES, RC2, etc. are simply mathematical computations that transform input bytes to output bytes having the characteristics of random byte data (where each byte value 00 through FF is equally possible, and the bytes are seemingly random). There is no file format. In other words, encrypting a file w/ any of these symmetric algorithms does not result in output that is structured in any way (i.e. no headers, no identifying structure, etc.) Decryption is simply the reverse mathematical computation.

A method such as CkDecryptFile has a success/failure return because other things may happen that cause a failure. For example, maybe the input file could not be found or opened, or maybe the output file could not be created...


answered Aug 29 '12 at 16:12

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Aug 29 '12 at 16:04

Seen: 3,208 times

Last updated: Aug 29 '12 at 16:12

powered by OSQA