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

  • Home
  • SEARCH
  • 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 8486501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:57:43+00:00 2026-06-10T20:57:43+00:00

I have a Encryption – Decryption scenario as shown below. //[Clear text ID string

  • 0

I have a Encryption – Decryption scenario as shown below.

//[Clear text ID string as input] — [(ASCII GetByte) + Encoding] — [Encrption as byte array] — [Database column is in VarBinary] — [Pass byte[] as VarBinary parameter to SP for comparison]

//[ID stored as VarBinary in Database] — [Read as byte array] — [(Decrypt as byte array) + Encoding + (ASCII Get String)] — Show as string in the UI

My question is in the decryption scenario. After decryption I get a byte array. I am doing an encoding (IBM037) after that. Is it correct?
Is there something wrong in the flow shown above?

private static byte[] GetEncryptedID(string id)
{
    Interface_Request input = new Interface_Request();
    input.RequestText = Encodeto64(id);
    input.RequestType = Encryption;

    ProgramInterface inputRequest = new ProgramInterface();
    inputRequest.Test_Trial_Request = input;

    using (KTestService operation = new KTestService())
    {
        return ((operation.KTrialOperation(inputRequest)).Test_Trial_Response.ResponseText);
    }
}


private static string GetDecryptedID(byte[] id)
{
    Interface_Request input = new Interface_Request();
    input.RequestText = id;
    input.RequestType = Decryption;

    ProgramInterface request = new ProgramInterface();
    request.Test_Trial_Request = input;

    using (KTestService operationD = new KTestService())
    {
            ProgramInterface1 response = operationD.KI014Operation(request);
            byte[] decryptedValue = response.ICSF_AES_Response.ResponseText;
            Encoding sourceByteFormat = Encoding.GetEncoding("IBM037");
            Encoding destinationByteFormat = Encoding.ASCII;

            //Convert from one byte format to other (IBM to ASCII)
            byte[] ibmEncodedBytes = Encoding.Convert(sourceByteFormat, destinationByteFormat,decryptedValue);
            return System.Text.ASCIIEncoding.ASCII.GetString(ibmEncodedBytes);

        }
    }

    private static byte[] EncodeTo64(string toEncode)
    {
        byte[] dataInBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(toEncode);
        Encoding destinationByteFormat = Encoding.GetEncoding("IBM037");
        Encoding sourceByteFormat = Encoding.ASCII;

        //Convert from one byte format to other (ASCII to IBM)
        byte[] asciiBytes = Encoding.Convert(sourceByteFormat, destinationByteFormat, dataInBytes);
        return asciiBytes;
    }
  • 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-10T20:57:45+00:00Added an answer on June 10, 2026 at 8:57 pm

    I found the answer -while decryption process, after decrypting I am converting IBM037 byte to ASCII byte. Thats why there is encoding coming in. I have updated the code in the question also (with more explanatory variables)

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

Sidebar

Related Questions

I have a very annoying problem with the unreliable encryption and decryption of string
I have made simple encryption/decryption method in php that I'm trying to move to
I need a CORE that will perform AES-128 Encryption/Decryption. I have searched online but
I have a PHP script that does basic encryption of a string through the
I have an mcrypt encryption and decryption routine within one of my Android apps.
i have a java program . this is a AES encryption - decryption program.
I Currently perform a large amount of encryption/decryption of text in c# using AES.
I am interested if it's possible to do string encryption/decryption using Excel Visual Basic
In my application I am using encryption and decryption. Before entering the string in
Not a long time ago I discovered RSA Encryption / Decryption and I have

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.