.cry files are weak encrypted text files used in VirtualSkipper and early versions of TrackMania. For example, the VskBoatImporter of VirtualSkipper creates an Info.cry from the Info.txt with the basic information about the boat (name, website, author) and adds it to the boat zip file. As a cipher, the XOR encryption is used with a rotating key. After encryption, the ciphertext is compressed by LZO method.
uint32 uncompressedSize uint32 compressedSize compressedData[compressedSize]
Restore the plaintext
After the data block is decompressed, the text string can be decrypted by applying the bitwise XOR operator to each character with the given key. The default key is rotated bitwise to the left, depending on the length of the text. The new key is then extended to the text length by repeating it:
uint64 key = 0xCF08317C90460052; uint32 shift = uncompressedSize & 0x3F; uint64 rotkey = (key << shift) | (key >> (64 - shift)); for (int i = 0; i < uncompressedSize; i++) uncompressedData[i] ^= *( (byte*)&rotkey + (i & 0x7) );