In computing, RAR is a proprietary file format for data compression and archiving, developed by Eugene Roshal (hence the name RAR: Roshal ARchive).
The filename extension used by RAR is .rar. If a RAR-archive is broken into many smaller files (a "multi-volume archive"), as is often the case when it was distributed on Usenet, then those smaller files carry the extensions .rar, .r00, .r01, .r02 etc. and most unrar programs reconstruct the whole archive when provided with the .rar file.
RAR compression operations are typically much slower than compressing the same data with early compression algorithms like ZIP and gzip, but with a much better rate of compression.
Apart from the rate of compression, RAR has several other original features:
- It is able to handle efficiently split volumes. Before the advent of RAR the most notable such format was ARJ. It is unnecessary to use split volumes for this purpose alone since just binary splitting the files will work fine, and they can be reassembled with cat or binary copy. Multi-volume files have wide use though, mainly because they are generally easier to handle, especially when the file is spanning multiple disks. Built-in support for multi-volume files enable the unpacking program to simply prompt the user for the next disk, without the need to manually copy and then rejoin the pieces, or for extracting a file from a single piece without needing all pieces. Unfortunately, RAR does not support tapes, as it uses seek and rename operations on its files.
- Variable amounts of redundancy (“recovery record”) can be added to an archive, making it more resistant to corruption. Even if parts of an archive are damaged, it is possible to fully recover the stored data if a large enough recovery record exists.
- RAR archives can be of a solid format, in which all of the compressed files are treated as a single data block. Most currently used compression formats (with the exception of the older ZIP) allow solid structuring.
- It features strong encryption capabilities. Older versions of the file format used a proprietary algorithm; newer versions use the AES encryption algorithm, a block cipher adopted as an encryption standard by the U.S. government. The only known ways to recover an encrypted file are via dictionary or brute force attacks, which are usually infeasible with non-dictionary passphrases starting from 8 characters.
- In newer versions password protection can optionally protect filenames too, so that the files contained within the archive will not be displayed without the right password.
- (Win)RAR also has the capability of storing NTFS streams and security information within the archive – information that is usually lost on compression. Under OS/2 RAR also handles extended attributes.
- Windows versions (WinRAR) starting from 3.60 have support for multi-threading, enabling the utilization of multiple CPUs/cores for parallel processing.
- Versions of RAR up to 2.50 closely resemble earlier versions of Norton Commander.
- RAR files can be embedded in other file types, probably the most common being JPEG. Image handling programs, browsers, and other utilities usually ignore any additional data after the end of the image, while RAR ignores anything before the RAR header. The procedure to create such a file is to append a RAR file to a JPEG. (e.g.: in DOS/Windows command-line: copy /b image1.jpg+something.rar image2.jpg, in UNIX: cat image1.jpg something.rar >> image2.jpg).