Archive::Tyd - Perl extension for simple file archiving.
use Archive::Tyd; my $tyd = new Archive::Tyd (password => 'secret password'); # Load an archive. $tyd->openArchive ("./archive.tyd"); # Add a file. $tyd->addFile ("./secret image.jpg"); # Write the archive. $tyd->writeArchive ("./archive.tyd"); # Read the secret rules. my $rules = $tyd->readFile ("rules.txt");
Tyd is a simple archiving algorith for merging multiple files together and encrypting the results, hence a password-protected archive.
Tyd Does: Reading and writing of encrypted Tyd archives and file operations within.
Tyd Does: Load all files into memory. Tyd is not good as a storage device for a large quanitity of large files. Tyd is best for keeping small text files and graphics together (maybe to keep a spriteset and definitions for a game?)
Tyd Does Not: support directories within the archive, compression of files, and many other things that WinZip and GZip support.
Creates a new Tyd object. You can pass in defaults here (such as password and debug).
(Re)define the password to be used. The default password is 'default'.
Open the archive and decrypt it with the password. You can load multiple archives with one object, and even change the password between each one.
Writes all the files to the archive using the current password.
Adds FILEPATH to the archive. The file will later be called by its file name, not the whole path (i.e. just "readme.txt", not "C:/secret folder/readme.txt")
Delete the file from the archive.
Read the file. It will return the binary data of the file (which you can then save to another file or whatever).
Returns an array of each file in the archive.
Takes a file path and returns its name
Creates the ciphering object. Supply FORCE for it to recreate the object forcefully (used when you call the password method to change the password).
I made this module to use with games I make which will allow users to create their own quests and store ALL of their data (maps, sound effects, tilesets, etc) into a single, password-protected file.
This module was not meant to compress files in any way. The resulting archive should be little more than the original size of all the files archived inside of it. This algorithm is only for tying files together and password protecting them.
The algorithm is quite simple. When not encrypted, the archive file would read like this:
filename::data filename::data filename::data ...
Once the unencrypted file is ready, the entire thing is encrypted using Crypt::CipherSaber with the password provided and written to the archive.
Version 0.02 - Fixed some major bugs. In 0.01 version, reading an archive Tyd file and then re-archiving it from the files in-memory, would for some reason corrupt the file. This has been repaired. - Carriage Returns are now filtered in and out correctly. - Included Tydra--a Perl/Tk interface to Tyd Archive Viewing. Version 0.01 - Initial Release
Crypt::CipherSaber
C. J. Kirsle, <kirsle "@" rainbowboi.com>
Copyright (C) 2005 by C. J. Kirsle
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.
To install Archive::Tyd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Archive::Tyd
CPAN shell
perl -MCPAN -e shell install Archive::Tyd
For more information on module installation, please visit the detailed CPAN module installation guide.