Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9247379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:42:44+00:00 2026-06-18T09:42:44+00:00

I am trying to write and read binary data from DynamoDB using SDK php

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:42:45+00:00Added an answer on June 18, 2026 at 9:42 am

    The main thing was that the binary data is stored in base64 in DynamoDB even if you provided it in raw format. so to get the raw binary back I had to use

    base64_decode($response->getPath('Item/IV/B'))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to read binary data from a specific offset. I write the data
I'm trying to write/read a double matrix to file as binary data but I'm
I am trying to read binary data from sys.stdin using Python 2.7 on Windows
I'm trying to read binary data in a C program with read() but EOF
I'm trying to pull some binary data from a database and write them to
i'd like to read binary data from a blob, using the Stream interface around
I am trying to program using C to write binary data to a .bin
I am trying to write data to a binary file and then read back
In my program, I am trying to read data from binary file, and then
I am trying to read a binary file from a program that writes a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.