What Is The Process Of Compress And Encryption
Sign in

What is the Process of Compress and Encryption

RAR is widely used to compress files including word, Excel, folders, graphics and even videos. But not many people know that RAR can be added passwords to prevented others to view the information it included. Actually, set password to your RAR files with WinRAR is very easy.

1)Click on the file for which you want to add the password .

2)Click on "Add to Archive".

3)Then go to Advanced tab.

4)Click on set password.

5)Click ok.

6)A WinRAR file with your filename will be created.

7)Next you may delete the original file, as you have now compressed it with a password.

Now that you’ve known how to set RAR password, but do you how does RAR can do it? And how can RAR recognize the password you entered is right? When you read the article, you will understand why.

The RAR file file is encrypted with Winrar in total of two steps:

1. Compress the first source file into a data segment. encrypt

2. Then encrypt the compressed file.

For the same source file, it won’t be encrypted because after compression, the data in the files is the same. But if the same source file, even though they use the same password, encrypted rar file complete data segment is not the same, which is due to the encryption key is dependent on a Salt (8 byte key, used to encrypt and store inside the rar file header)

So the key to decrypt rar encrypted file is data encryption step, then we next look at how encryption.

The process of encrypting "compressed the data segment":

1. Access keys:

Would be a plaintext password and Salt together, through HASH algorithm to generate two 16-byte key. (One is KEY (AES algorithm parameters), one initVector)

2. Encrypt and compress data with Key and initVector:

Here is an encrypted loop structure, each 16 bytes as a block encryption (which is why encryption may complete the total file length is 16 multiple reasons). Encryption using AES algorithm (RAR uses a standard application of AES rijndael). This Note: AES encryption before, there is an exclusive-or operation, is the first 16 bytes of each block with a 16-byte block on the results of XOR encryption, then the AES algorithm. I use a simple schematic description of the code to see:

packblock [0] = packblock ^ initVector

encryptBlock [0] = AES (packblock [0]); (KEY is the AES key)

for i = 1 to i-1

packblock = packblock ^ encryptBlock [i-1]

encryptBlock = AES (packblock); (KEY is the AES key)

next

; Packblock that compressing 16 bytes of data each

; EncryptBlock that end of every 16 bytes of encrypted data

The decryption process

As the AES algorithm is symmetrical, so decryption process is the inverse of the encryption process. However, the process of decryption and encryption AES algorithm used is not the same (because decryption sub-keys generated by the KEY table is not the same). We still need to input the password (If you forget the password, you can try rar password recovery), and salt together to produce two 16-byte key, KEY, and initVector.

packblock [0] = AES1 (encryptBlock [0]); (KEY is the AES key)

packblock [0] = packblock ^ initVector

for i = 1 to i-1

packblock = AES1 (encryptBlock); (KEY is the AES key)

packblock = packblock ^ encryptBlock [i-1]

next

Then how can it determine the entered password is correct or not? Decryption is the process of decrypted data block to extract, then the solution into a source file, the file CRC check, there is a RAR file of the source files CRC checksum comparison, the same as the password is correct, or the password is wrong.

Now you have learned the principles of compression and decryption, you will know about RAR. If you lost your RAR password, you can deal with the things easily, just by using password recovery software, it is a nice tool to find all the password for your Windows Live, MSN, Hotmail, Yahoo, RAR, Excel, Office 2000 ~ 2010, etc. In words, any password you forget, you can find it out in easy and fast way.

start_blog_img