Verify that the file is encrypted by looking at its first 4 bytes. If it's the magic string PARE then this is a parquet with encrypted footer.
(path)
| 107 | |
| 108 | |
| 109 | def verify_file_encrypted(path): |
| 110 | """Verify that the file is encrypted by looking at its first 4 bytes. |
| 111 | If it's the magic string PARE |
| 112 | then this is a parquet with encrypted footer.""" |
| 113 | with open(path, "rb") as file: |
| 114 | magic_str = file.read(4) |
| 115 | # Verify magic string for parquet with encrypted footer is PARE |
| 116 | assert magic_str == b'PARE' |
| 117 | |
| 118 | |
| 119 | def read_external_keys_to_dict(path): |