More improvements

Implemented password check, added TODOs, simplified file size
calculation.