﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » Can't decrypt encrypted file (Error: Lenght of the encrypted data is invalid)</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 04:12:28 GMT</lastBuildDate><ttl>20</ttl><item><title>Can't decrypt encrypted file (Error: Lenght of the encrypted data is invalid)</title><link>http://forum.strataframe.net/FindPost27166.aspx</link><description>Hi,&lt;br&gt;
I try to encrypt and store files in SQL Server database [binarydata] VarChar(MAX) field..&lt;br&gt;
Problem is.. I can't DECRYPT already ecnrypted file.. (with strings I have no problem)&lt;br&gt;
&lt;br&gt;
1) Way to encrypt and SaveFile in the Database&lt;br&gt;
&lt;br&gt;
Dim loEncrypt As MicroFour.StrataFrame.Security.Encryption.TripleDESWrapper = New MicroFour.StrataFrame.Security.Encryption.TripleDESWrapper&lt;br&gt;
loEncrypt.EncryptFile(lcFilename)&lt;br&gt;
Dim lcSQLExpr = String.Format("UPDATE [ErpData].[dbo].[KONTAKTE_DOKUMENTE] SET [BinaryData] = (SELECT BulkColumn FROM OPENROWSET(BULK '{0}', SINGLE_BLOB) AS InsertData) WHERE PK_ID = {1}", lcFilename, tnDocumentId)&lt;br&gt;
If Me.ExecuteNonQuery(lcSQLExpr) &gt; 0 Then&lt;br&gt;
        File.Delete(lcFilename)&lt;br&gt;
End If&lt;br&gt;
&lt;br&gt;
==== On this step I encrypt the file and save data into binarydata field&lt;br&gt;
&lt;br&gt;
2) I try to restore and decrypt file&lt;br&gt;
&lt;br&gt;
' Here is "ME" is businessObject.&lt;br&gt;
&lt;br&gt;
                Dim fs As FileStream = New FileStream(lcFilename, FileMode.CreateNew, FileAccess.Write)&lt;br&gt;
                Dim bw As BinaryWriter = New BinaryWriter(fs)&lt;br&gt;
                bw.Write(Me.binarydata, 0, Me.binarydata.Length)&lt;br&gt;
                bw.Flush()&lt;br&gt;
                bw.Close()&lt;br&gt;
                fs.Close()&lt;br&gt;
Dim loEncrypt As MicroFour.StrataFrame.Security.Encryption.TripleDESWrapper = New MicroFour.StrataFrame.Security.Encryption.TripleDESWrapper&lt;br&gt;
&lt;br&gt;
        Try&lt;br&gt;
            loEncrypt.DecryptFile(lcFilename)&lt;br&gt;
            lcReturn = lcFilename&lt;br&gt;
        Catch ex As Exception&lt;br&gt;
            MicroFour.StrataFrame.Messaging.MessageForm.ShowMessage(ex.Message)&lt;br&gt;
        End Try&lt;br&gt;
&lt;br&gt;
=======! HERE I'V GOT AN EXCEPTION "The length of the encrypted is invalid"&lt;br&gt;
&lt;br&gt;
I expect something wrong with BinaryWriter.. but what?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Denis&lt;br&gt;
&lt;br&gt;</description><pubDate>Thu, 20 May 2010 02:08:12 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Can't decrypt encrypted file (Error: Lenght of the encrypted data is invalid)</title><link>http://forum.strataframe.net/FindPost27183.aspx</link><description>Hi Ivan,&lt;br&gt;
Yes.. my main mistake was using wrong type.. varchar(max) instead varbinary(max), now it works without any conversion operation to string &lt;br&gt;
&lt;br&gt;
Thanks for attention&lt;br&gt;
Denis</description><pubDate>Thu, 20 May 2010 02:08:12 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Can't decrypt encrypted file (Error: Lenght of the encrypted data is invalid)</title><link>http://forum.strataframe.net/FindPost27180.aspx</link><description>Glad you got it working!</description><pubDate>Wed, 19 May 2010 10:52:10 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Can't decrypt encrypted file (Error: Lenght of the encrypted data is invalid)</title><link>http://forum.strataframe.net/FindPost27178.aspx</link><description>Hi Denis.&lt;/P&gt;&lt;P&gt;I have created a sample following Greg's code and it works fine over here. To test it, I created a varbinary(MAX) in the Customer table of the&amp;nbsp;StrataFrameSample database and used it to store a .pdf file (you will find it in the project folder itself) called TestPDF.pdf. You can find the sample at the SF Users Contributed Samples (&lt;A href="http://forum.strataframe.net/Forum26-1.aspx"&gt;http://forum.strataframe.net/Forum26-1.aspx&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;There are two buttons, one encrypt the file and save the BO. The other reads the contents of the BO and creates a file on the Desktop (change the line where the FileStream is created to address your Desktop).&lt;/P&gt;&lt;P&gt;Hope it helps.</description><pubDate>Wed, 19 May 2010 09:53:24 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Can't decrypt encrypted file (Error: Lenght of the encrypted data is invalid)</title><link>http://forum.strataframe.net/FindPost27176.aspx</link><description>Ok.&lt;br&gt;
Now problem is fixed.&lt;br&gt;
I choose wrong datatype for SQL Server field.&lt;br&gt;
&lt;br&gt;
Now I change it to varbinary(MAX) and all works perfect&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Denis</description><pubDate>Wed, 19 May 2010 09:48:26 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Can't decrypt encrypted file (Error: Lenght of the encrypted data is invalid)</title><link>http://forum.strataframe.net/FindPost27174.aspx</link><description>Ok.. Now for me it does not work with encoding/ without encoding .. the code next&lt;/P&gt;&lt;P&gt;In case when file NOT ENCRYPTED - the binary file stored on the disk correct.&lt;BR&gt;When file is encrypted - I have a next :&lt;/P&gt;&lt;P&gt;Encrypting:&lt;BR&gt;1) Dim contents As Byte() = File.ReadAllBytes(lcFilename)&amp;nbsp; LENGHT is 85668&lt;BR&gt;2)&amp;nbsp; Dim encryptedContents As Byte() = loEncrypt.Encrypt(contents) - LENGHT is 85672&lt;/P&gt;&lt;P&gt;Decrypting:&lt;BR&gt;1) Dim encryptedContents As Byte() = System.Text.Encoding.Unicode.GetBytes(contents)&amp;nbsp; - LENGHT is 85672&lt;BR&gt;2) loBytes = loEncrypt.Decrypt(encryptedContents) - LENGHT is 85671 !!!!!!!!!!!!!!!!&lt;/P&gt;&lt;P&gt;and as result - file not readable..&lt;/P&gt;&lt;P&gt;Below my code&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;P&gt;1) Attach file to the database&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If KontaktE_DOKUMENTEBO1.isembedded Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim lcFilename As String = KontaktE_DOKUMENTEBO1.location&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If File.Exists(lcFilename) Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If KontaktE_DOKUMENTEBO1.geschuetzt = True Then&amp;nbsp;&amp;nbsp;&amp;nbsp; ' When the document is password protected&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim loEncrypt As MicroFour.StrataFrame.Security.Encryption.TripleDESWrapper = New MicroFour.StrataFrame.Security.Encryption.TripleDESWrapper&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim contents As Byte() = File.ReadAllBytes(lcFilename)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim encryptedContents As Byte() = loEncrypt.Encrypt(contents)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.KontaktE_DOKUMENTEBO1.binarydata = System.Text.Encoding.Unicode.GetString(encryptedContents)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim loBytes As Byte() = File.ReadAllBytes(lcFilename)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.KontaktE_DOKUMENTEBO1.binarydata = System.Text.Encoding.Unicode.GetString(loBytes)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File.Delete(lcFilename)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim lcMessage = ex.Message&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;&lt;P&gt;&lt;BR&gt;2) Restore File to the Disk Code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim contents As String = Me.binarydata&amp;nbsp;&amp;nbsp;&amp;nbsp; 'BusinessObject VarChar(MAX) field&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim loBytes As Byte()&lt;/P&gt;&lt;P&gt;'&amp;nbsp; When file neccessary to decrypt - then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If tlDecrypt Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim loEncrypt As MicroFour.StrataFrame.Security.Encryption.TripleDESWrapper = New MicroFour.StrataFrame.Security.Encryption.TripleDESWrapper&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim encryptedContents As Byte() = System.Text.Encoding.Unicode.GetBytes(contents)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loBytes = loEncrypt.Decrypt(encryptedContents)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;BR&gt;'&amp;nbsp; When file not encrypted&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loBytes = System.Text.Encoding.Unicode.GetBytes(contents)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim fs As FileStream = New FileStream(tcFilename, FileMode.CreateNew, FileAccess.Write)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim bw As BinaryWriter = New BinaryWriter(fs)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bw.Write(loBytes, 0, loBytes.Length)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bw.Flush()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bw.Close()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fs.Close()&lt;BR&gt;[/codesnippet]</description><pubDate>Wed, 19 May 2010 08:53:30 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Can't decrypt encrypted file (Error: Lenght of the encrypted data is invalid)</title><link>http://forum.strataframe.net/FindPost27173.aspx</link><description>Hi,&lt;br&gt;
Your code works only with Text files.. when I restore binary file like PDF to the disk.. the file is corrupt&lt;br&gt;
RTF file reads ok.. PDF - not&lt;br&gt;
&lt;br&gt;
Here I extracting file from database&lt;br&gt;
&lt;br&gt;
Private Function mmks_DeryptFile(ByVal tcFilename As String, ByVal tlDecrypt As Boolean)&lt;br&gt;
        Dim lcReturnResult As String = tcFilename&lt;br&gt;
        Dim contents As String = Me.binarydata&lt;br&gt;
        '-- Decrypt code&lt;br&gt;
        If tlDecrypt Then&lt;br&gt;
            Dim loEncrypt As MicroFour.StrataFrame.Security.Encryption.TripleDESWrapper = New MicroFour.StrataFrame.Security.Encryption.TripleDESWrapper&lt;br&gt;
            Dim encryptedContents = Me.binarydata&lt;br&gt;
            contents = loEncrypt.Decrypt(encryptedContents)&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
        Dim fs As FileStream = New FileStream(tcFilename, FileMode.CreateNew, FileAccess.Write)&lt;br&gt;
        Dim bw As BinaryWriter = New BinaryWriter(fs)&lt;br&gt;
        Dim encoding As System.Text.ASCIIEncoding = New System.Text.ASCIIEncoding&lt;br&gt;
        Dim loBytes As Byte() = encoding.GetBytes(contents)&lt;br&gt;
        bw.Write(loBytes, 0, loBytes.Length)&lt;br&gt;
        bw.Flush()&lt;br&gt;
        bw.Close()&lt;br&gt;
        fs.Close()&lt;br&gt;</description><pubDate>Wed, 19 May 2010 07:39:39 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Can't decrypt encrypted file (Error: Lenght of the encrypted data is invalid)</title><link>http://forum.strataframe.net/FindPost27169.aspx</link><description>I think the problem might be the EncryptFile method.  It is marked as obsolete and apparently causes major file corruption issues. Use the Encrypt/Decrypt methods instead. You can either open a stream and pass the bytes to these methods or read the contents and pass strings:&lt;br&gt;
&lt;br&gt;
[codesnippet]Dim loEncrypt As New TrippleDESWrapper()&lt;br&gt;
Dim contents As String = File.ReadAllText(lcFilename)&lt;br&gt;
Dim encryptedContents As String = loEncrypt.Encrypt(contents)&lt;br&gt;
...&lt;br&gt;
'-- Decrypt code&lt;br&gt;
Dim encryptedContents = myBoInstance.ContentProperty&lt;br&gt;
Dim contents As String = loEncrypt.Decrypt(encryptedContents )[/codesnippet]</description><pubDate>Tue, 18 May 2010 10:31:59 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Can't decrypt encrypted file (Error: Lenght of the encrypted data is invalid)</title><link>http://forum.strataframe.net/FindPost27168.aspx</link><description>Hi Greg,&lt;br&gt;
Thanks for response.&lt;br&gt;
1) Yes. When I do decrypt, and encrypt file on disk - it works perfect.&lt;br&gt;
I thinking the problem with BinaryWriter because my original before attach to database is 184Kb,&lt;br&gt;
And after BinaryWriter.Write file - its 280Kb..&lt;br&gt;
&lt;br&gt;
I change my code..&lt;br&gt;
              Dim fs As FileStream = New FileStream(lcFilename, FileMode.CreateNew, FileAccess.Write)&lt;br&gt;
                Dim bw As BinaryWriter = New BinaryWriter(fs)&lt;br&gt;
                Dim encoding As System.Text.ASCIIEncoding = New System.Text.ASCIIEncoding&lt;br&gt;
                Dim loBytes As Byte() = encoding.GetBytes(Me.binarydata)&lt;br&gt;
                bw.Write(loBytes, 0, loBytes.Length)&lt;br&gt;
                bw.Flush()&lt;br&gt;
                bw.Close()&lt;br&gt;
                fs.Close()&lt;br&gt;
&lt;br&gt;
But still have a problem - but now error message is diffrent. It says : Data is invalid..&lt;br&gt;
Probably something wrong with Encoding&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Denis</description><pubDate>Tue, 18 May 2010 09:58:36 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Can't decrypt encrypted file (Error: Lenght of the encrypted data is invalid)</title><link>http://forum.strataframe.net/FindPost27167.aspx</link><description>I don't have time to test your code, but in the mean time there are two things you might test: &lt;br&gt;
&lt;br&gt;
First, does the encryption/decryption work if you just encrypt the file, then decrypt it? This would isolate the problem to either the encryption related code or the database related code.&lt;br&gt;
&lt;br&gt;
Second, you might consider providing a key and vector to the TripleDESWrapper constructor.&lt;br&gt;
&lt;br&gt;
When I get a chance (if you haven't already figured it out), I'll run a quick test to see what I come up with.</description><pubDate>Tue, 18 May 2010 09:34:39 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>