I am trying to write and read binary data from DynamoDB using SDK php 2.
I can write the data to the table but when I read it, it comes in a different format how to cast it back to its original binary format.
$put_response = $dynamodb->putItem(array(
'TableName' => 'TableName',
'Item' => array(
'Id' => array( 'S' => 'werwer' ), // Primary Key
'IV' => array( 'B' => openssl_random_pseudo_bytes(50)),
'Password' => array( 'B' => $encrypt->EncryptER("asdasd") )
)
));
When I read the IV attribute or the Password I get a different value for it, what is the cast that I should do or if there is a function to convert the string back to binary.
This is what I get if I do echo before storing the value in Dynamo �LX�x��ʝ�t]�>0
This is the echo of the variable after reading it from Dynamo GdNMWLt4nZrKnc50XdE+MA==
Thanks