Add functions for generating new file signatures.
Fix bug in file signature validation function.