2

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
NoSQLKnowHow
  • 4,449
  • 23
  • 35
divyanayan awasthi
  • 890
  • 1
  • 8
  • 33
  • did you get the answer here? have same problem with Java code – levo4ka Dec 14 '21 at 06:23
  • its not possible with the approach . you need a unique identifier. to do that you can also use one way hashing to the data to get information from the table. if you need more inputs let me know. – divyanayan awasthi Dec 14 '21 at 12:53

0 Answers0