dtab-1.1.0.1: Harmonix (Guitar Hero, Rock Band) DTA/DTB metadata library

Safe HaskellNone
LanguageHaskell2010

Data.DTA.Crypt

Description

The encryption scheme used for DTB files found on game discs.

Synopsis

Documentation

oldCrypt :: Crypt Source #

The lazy infinite list of crypt bytes for old-style encryption.

newCrypt :: Crypt Source #

The lazy infinite list of crypt bytes for new-style encryption.

decrypt :: Crypt -> ByteString -> ByteString Source #

Take the first four bytes of the string as the key, and decrypt the rest of the file.

encrypt :: Crypt -> Key -> ByteString -> ByteString Source #

Encrypt a string with a key, and append the key to the encrypted string.

decryptFile :: Crypt -> FilePath -> FilePath -> IO () Source #

Decrypt an encrypted DTB file using the given crypt method.

encryptFile :: Crypt -> Key -> FilePath -> FilePath -> IO () Source #

Encrypt an unencrypted DTB file using the given crypt method and key.

decryptHandle :: Crypt -> Handle -> Handle -> IO () Source #

Decrypt an encrypted DTB file across two handles.

encryptHandle :: Crypt -> Key -> Handle -> Handle -> IO () Source #

Encrypt an unencrypted DTB files across two handles.

type Key = Word32 Source #

An encryption/decryption key.

type Crypt = Key -> [Word8] Source #

Using a key to generate an infinite stream of crypt bytes.