title: Encrypt/Decrypt Sql Server 2005 encrypted column in .Net
body: <p>I am in need to encrypt/decrypt data that has been encrypted on the database (Sql Server 2005) level in the .Net code. RjindaelManaged with 256 bit key length and 128 bit block size is the equivalent of AES 256 algorithm, but I don't know how to go about matching Key and IV so that both Sql Server and .Net encryption methods would produce same results.</p>
  
  <p>Has anyone come across this in the past?</p>
  
  <p>Sql Server key is created with code similar to the one below:</p>
  
  <pre><code>create symmetric key SomeKeyName
    with 
      algorithm = AES_256,
      key_source = 'SomePassword',
      identity_value = 'SomePassword'
      encryption by certificate SomeCertificate
  </code></pre>