fixed some bugs with EOF symbol;
add function to work with files, which works correctly with zeros at the end;
add function to generate key to file