SHA and AES serve for different purposes. SHA is used to generate a data hash, and AES is used to encrypt data.
Here is an example of when the SHA hash is useful to you. Let's say you wanted to download an ISO DVD image from some Linux distribution. This is a large file, and sometimes things go wrong - so you want to check if the file you uploaded is correct. What you will do is go to a trusted source (for example, to the official distribution download point), and they usually have a SHA hash for the ISO image. Now you can create a comparable SHA hash file (using any number of open tools) for your uploaded data. Now you can compare the two hashes to make sure they match - which will confirm the image you uploaded is correct. This is especially important if you are getting an ISO image from an unreliable source (such as a torrent) or if you are having problems using the ISO and want to check if the image is damaged.
As you can see, in this case the SHA was used to check for data that was not corrupted. You have every right to see the data in ISO.
AES, on the other hand, is used to encrypt data or does not allow people to view this data, knowing some secret.
AES uses a shared key, which means that the same key (or associated key) that is used to decrypt the data is used to encrypt the data. For example, if I encrypted an email using AES, and I sent you this email, you and I should have known the common key used to encrypt and decrypt the email. This is different from algorithms that use a public key, such as PGP or SSL.
If you want to collect them together, you can encrypt the message using AES and then send the SHA1 hash code of the unencrypted message so that when decrypting the message, they can verify the data. This is a somewhat contrived example.
If you want to know more about these few Wikipedia search terms (besides AES and SHA) that you want to try, follow these steps:
Symmetric Key Algorithm (for AES) Cryptographic Hash Function (for SHA) Public Key Cryptography (for PGP and SSL)
Robert Horvick Jun 13 '09 at 14:26 2009-06-13 14:26
source share