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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:02:14+00:00 2026-05-26T04:02:14+00:00

I have test input string (key=value&key=value…) and key (like this D2335A9CA4924D9F914D2B47B450D436) I need to

  • 0

I have test input string (key=value&key=value…) and key (like this D2335A9CA4924D9F914D2B47B450D436)
I need to Encrypt my string using AES encryption but my result is not equal to provider’s result. Result example :
AD0C66FB3C1204A8B0AC68AA9B9E3029C86DFF5872753F2F8D7B68EA667D8616215C20F831ABD5A4D56F286E471651AE5C15BCEB2F368200B4D9F3F6D2F0791E8F45D45FD ………………..
What I’m doing wrong? (googlized code)

public static string Encrypt(string toEncrypt)
        {
            byte[] keyArray = ASCIIEncoding.ASCII.GetBytes("D2335A9CA4924D9F914D2B47B450D436");
            byte[] toEncryptArray = ASCIIEncoding.ASCII.GetBytes(toEncrypt);
            RijndaelManaged rDel = new RijndaelManaged();
            rDel.Key = keyArray;
            rDel.KeySize = 128;
            rDel.BlockSize = 256;
            rDel.IV = keyArray;
            rDel.Mode = CipherMode.CFB; 
            rDel.Padding = PaddingMode.PKCS7; 
            ICryptoTransform cTransform = rDel.CreateEncryptor();
            byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
            return FormatByteArray(resultArray);
        }

        internal static string FormatByteArray(byte[] b)
        {
            System.Text.StringBuilder sb1 = new System.Text.StringBuilder();
            int i = 0;
            for (i = 0; i < b.Length; i++)
            {
                if (i != 0 && i % 16 == 0)
                    sb1.Append("\n");
                sb1.Append(System.String.Format("{0:X2} ", b[i]));
            }
            return sb1.ToString();
        }
  • 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-26T04:02:15+00:00Added an answer on May 26, 2026 at 4:02 am

    What I’m doing wrong?

    byte[] keyArray = ASCIIEncoding.ASCII.GetBytes("D2335A9CA4924D9F914D2B47B450D436");
    

    This can’t be right. It’ll give you 64 bytes, half of them 0x00.

    It looks like it’s Hex encoded, I think you’ll need a little loop to decode it.
    That would give you 16 bytes (128 bits).


    Old answer:


    You need to decode this string, it probably is Base64 encoded. Try:

    byte[] keyArray = System.Convert.FromBase64String("D2335A9CA4924D9F914D2B47B450D436")
    

    And check if you have a valid (length) key.

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

Sidebar

Related Questions

I have HashMap object contains a key x-y-z with corresponding value test-test1-test2 . Map<String,String>
I have a string of text like this: This is a[WAIT] test. What I
I have this (simplification): $(li).click(function{alert(test);}); <li> <input> </li> What's the best way to bind
I have this unit test: public void testDeEscapeResponse() { final String[] inputs = new
I have this string Sample Text <test@test.com> and this string test@test.com and I'm trying
How can I achieve the following using Regex/c# replace? Input string I have :
I have the following code: main = do putStr Test input : content <-
I have a form that I pre-populate with test data though jQuery. $('INPUT[name=subscription.FirstName]').val('Jef'); but
I have a test project using MbUnit and TestDriven.Net. If I right-click on an
I have the following: C:\temp\dowork.exe < input.txt processing....... complete C:\ I try this: processArguments

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.