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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:11:23+00:00 2026-05-23T13:11:23+00:00

How to generate Rijndael KEY and IV using a passphrase? The key length must

  • 0

How to generate Rijndael KEY and IV using a passphrase? The key length must be in 256 bits.

  • 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-23T13:11:24+00:00Added an answer on May 23, 2026 at 1:11 pm

    This is plug and play code that I found on internet. It just works:

    using System.IO;
    using System.Security.Cryptography;
    
    private static readonly byte[] SALT = new byte[] { 0x26, 0xdc, 0xff, 0x00, 0xad, 0xed, 0x7a, 0xee, 0xc5, 0xfe, 0x07, 0xaf, 0x4d, 0x08, 0x22, 0x3c };
    
    public static byte[] Encrypt(byte[] plain, string password)
    {
        MemoryStream memoryStream;
        CryptoStream cryptoStream;
        Rijndael rijndael = Rijndael.Create();
        Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(password, SALT);
        rijndael.Key = pdb.GetBytes(32);
        rijndael.IV = pdb.GetBytes(16);
        memoryStream = new MemoryStream();
        cryptoStream = new CryptoStream(memoryStream, rijndael.CreateEncryptor(), CryptoStreamMode.Write);
        cryptoStream.Write(plain, 0, plain.Length);
        cryptoStream.Close();
        return memoryStream.ToArray();
    }
    
    public static byte[] Decrypt(byte[] cipher, string password)
    {
        MemoryStream memoryStream;
        CryptoStream cryptoStream;
        Rijndael rijndael = Rijndael.Create();
        Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(password, SALT);
        rijndael.Key = pdb.GetBytes(32);
        rijndael.IV = pdb.GetBytes(16);
        memoryStream = new MemoryStream();
        cryptoStream = new CryptoStream(memoryStream, rijndael.CreateDecryptor(), CryptoStreamMode.Write);
        cryptoStream.Write(cipher, 0, cipher.Length);
        cryptoStream.Close();
        return memoryStream.ToArray();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My software is using AES Rijndael. I am using a SHA-256 hash to generate
I'm using C# .Net 4.0. I generate the key and IV(initialization vector) using the
I am currently currently using Rijndael 256-bit in CBC mode to encrypt some data
I'm trying out the Rijndael to generate an encrypted license string to use for
I generate some code using CXF from a WSDL-file. When compiling the code with
I generate a certification key with openssl. Here is my command: openssl genrsa -des3
I generate XML using JAXB2 for an standalone java app that uses maven 3,
I generate a pdf file from HTML using Pisa: def fetch_resources(uri, rel): path =
I generate some images using a PHP lib. Sometimes the browser does not load
I generate an Excel using an SQL query per each day: SELECT COUNT(res_id) as

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.