79094032

Date: 2024-10-16 12:34:57
Score: 0.5
Natty:
Report link

The encrypted columns were read as strings. I had to make conversion to bites to fix the problem.

def decrypt_field(field_value):
    '''        
    '''
    try:      
        return fernet_out.decrypt(ast.literal_eval(field_value)).decode()
    except Exception as e:
        print(e)  
        return field_value   


print(df['column'].apply(decrypt_field))

The output is what it should be.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: bravopapa