I have a DynamoDB table which as per requirement should have only serialNumber and created by .serialNumber should be encrypted . how can I search based on this column . since user would pass the actual serialNumber and I have to validate it against db .
how can I achieve the same ?
the encryption algo generates a different value on encryption .
I even tried using scan , but not able to search based on serial number value .
response = dynamodb.scan(TableName='table')
items = response['Items']
for item in items:
response = client.decrypt(
CiphertextBlob=item['serialNumber'],
KeyId='keyId',
EncryptionAlgorithm='SYMMETRIC_DEFAULT'
)
I get following error when trying to decrypt :
[ERROR] TypeError: 'str' object cannot be interpreted as an integer