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 6167459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:31:01+00:00 2026-05-23T22:31:01+00:00

If I run Convert.FromBase64String(test) I get the error that it’s invalid length. I’m trying

  • 0

If I run Convert.FromBase64String(“test”) I get the error that it’s invalid length. I’m trying to convert to a byte array so I can encrypt it, but on shorter strings it’s giving the length error. I tried rpadding with ‘=’ but no matter how many I put nothing seems to work.

What are my options with this?

  • 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-05-23T22:31:01+00:00Added an answer on May 23, 2026 at 10:31 pm

    If you have text data that you need to store as binary:

    • You convert a string to byte[] via Encoding.GetBytes(), for example Encoding.UTF8.GetBytes()
    • you convert such text data back to a string via Encoding.GetString(); this requires the binary to be valid text data via this encoding (not arbitrary binary)

    If you have binary data you need to store as a string;

    • you convert arbitrary binary to a string with Convert.ToBase64String()
    • you convert such a string back to binary with Convert.FromBase64String(); this requires the string to be a valid base-64 string (not an arbitrary string)

    So: look at Encoding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to convert this c code into MIPS and run it in SPIM. int
I'm creating a utility in C++ to be run on Linux which can convert
I am trying to convert some actions within a controller to run asynchronously in
How can I convert this code from C# to Python to be run on
I'm trying to convert an ASP .NET MVC 2 app to run on nginx/mono
Possible Duplicate: Can C# apps run without the .NET framework? How can I convert
I am trying to convert my test suite to use hydra It is working
I'm trying to convert data from one text input (form) into an array so
Just learning Automator here, but I'm trying to run a convert command on a
Can anyone help me convert this code to make it run recursively? I'm not

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.