Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My question rather splits into two sections:

  • Is AES correctly and security implemented in the .net Framework?

    Are there any reviews of implementation mistakes that would weaken the security of AES (e.g. against timing attacks)?

  • Error-checking with hash-then-encrypt

    I have a file i wish to transmit (encrypted), and would like to confirm that decryption was successful. To do this, I plan to take a hash of the file, append it to the file, then encrypt this. After decrypting, the receiver can re-calculate the hash, and compare it to the value I sent over.

    Is there a better way to check the decryption was correct?

share|improve this question
Your question is pretty vague. What kind of weakness in .net's AES are you looking for? Timing attacks? I wouldn't worry too much about problems with .net's library itself, but rather about your code using it. The bad API makes it hard to write secure encryption in .net. Your second question is even more vague, you didn't really describe your scheme. But it's probably not secure. There are several related questions, such as "Non-cryptographic hash function as MAC for stream ciphers". – CodesInChaos Feb 3 '13 at 14:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.