Skip to content

Update column with encrypted failed with TypeError #36

@vagarwal77

Description

@vagarwal77

Following this article and got an error - https://techsboot.com/blogs/redshift/encrypt_decrypt_udf_using_pyaes/
UPDATE secure_edw_t.emp_secure
SET emp_name_enc = udf_enc.aes_encrypt(emp_name, LPAD('empnameKey/fhci4=dnv73./xorb3f05', 32, 'z')),
emp_phone_enc = udf_enc.aes_encrypt(emp_phone, LPAD('empphoneKey29s0vne03]jv023n=bn34', 32, 'z'))
;

select * from svl_udf_log
13030 TypeError: object of type 'int' has no len() 2021-01-07 19:35:10 line 7, in aes_encrypt\n File "aes.py", line 557, in init\n AESBlockModeOfOperation.init(self, key)\n File "aes.py", line 304, in init\n self._aes = AES(key)\n File "aes.py", line 133, in init\n if len(key) not in (16, 24, 32):\n aes_encrypt 0 0 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions