The rars project has prepared a free implementation of RAR with support for archive creation.

The rars project introduces an open-source implementation of tools for the RAR format, written in Rust, supporting not only extraction but also creation of RAR archives. The toolset supports both earlier RAR formats 1.3/1.4 with the signature "RE~^" and the latest RAR 7 version. Advanced operations include volume splitting, password protection, header encryption, comment attachment, RARVM filters, quick opening indexes, and data recovery mechanisms. The code is distributed under MIT and Apache-2.0 licenses. Using the PyO3 library, Python bindings have been prepared that implement an API similar to rarfile for browsing, testing, and extracting archives, as well as an API similar to RarBuilder for creating or repacking archives.

The feature of this project is that it implements RAR format handling without using the unrar utility code, which is distributed under a non-free license that prohibits the use of unrar code to recreate the RAR compression algorithm or develop RAR-compatible archivers. Due to this restriction, most free archivers were limited to RAR file extraction features, while proprietary tools from RARLAB had to be used to create RAR archives.

A separate repository, rar-research, has been created where specifications for RAR formats 1.3/1.4, 1.5-4.x, and 5.0/7.0 are published, as well as notes on the algorithms, filters, integrity checking and recovery methods, encryption, volume splitting, and protection mechanisms used. Since there was no official complete specification at the time of the rars project's creation, the documentation was reconstructed from unpacker code, old implementations, test archives, and analysis of binary versions of RAR for DOS and Windows.

The implementation was created using OpenAI Codex 5.5 and Claude Opus 4.7 AI tools during free time over approximately five weeks. In the first phase, the models were applied to systematize information about the format and fill in gaps in the description, after which code was generated in Rust based on the reconstructed specification. To clarify the specification and refine the implementation, the functionality was tested on real archives and compared with reference implementations.

It is noted that AI tools performed well in translating formal descriptions into code and in the routine implementation of a large volume of functionality, but they were unable to provide architectural oversight. Without strict supervision, the AI models tended to bypass tests, complicate the code, and overlook obvious issues affecting usability. According to the author, in a project of this scale, tests, documentation, and comments became not just tools for verification, but also a way to guide the generation of code in the right direction.

Development was accelerated after the introduction of the ‘/goal’ mode in OpenAI Codex, allowing the AI agent to work on a single task for an extended period, compressing context and continuing execution after it was overwhelmed. In this mode, Codex worked for over 6 hours several times and once for about 16 hours, implementing significant remaining functionality such as data recovery, encryption, and multi-volume archives. Considering the substantial subsidy for tokens, £40 was spent.

In terms of compression level, rars lags behind WinRAR by an average of 5-10%. In terms of compression and decompression speed, rars is significantly slower than WinRAR due to the lack of comprehensive optimizations. However, the project already includes a ‘--features fast’ mode that applies optimizations based on SIMD instructions to accelerate compression and decompression, but it is tied to the experimental API std::simd, available only in test builds of the Rust toolchain. A ‘--features parallel’ mode has also been implemented, which uses the Rayon library to parallelize the compression of individual files.

Evgeny Roshal, the creator of RAR, commented on the use of reverse engineering of old RAR binary files during the development of rars, which is prohibited by the licensing agreement. According to Evgeny, he has not yet decided what to do about it and intends to wait for the opinion of the company win.rar GmbH.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster