reliable detect encrypted files

we need read the file to reliable detect if it is encrypted or not.

cc @PVince81