Click here to Skip to main content
12,448,720 members (55,060 online)

Visual Basic

 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner28-Nov-12 10:35
memberJRHibner28-Nov-12 10:35 
QuestionChanging Assembly Properties through Reflection Pin
DisIsHoody14-Nov-12 9:38
memberDisIsHoody14-Nov-12 9:38 
AnswerRe: Changing Assembly Properties through Reflection Pin
Eddy Vluggen15-Nov-12 1:18
memberEddy Vluggen15-Nov-12 1:18 
GeneralRe: Changing Assembly Properties through Reflection Pin
DisIsHoody15-Nov-12 17:14
memberDisIsHoody15-Nov-12 17:14 
GeneralRe: Changing Assembly Properties through Reflection Pin
Eddy Vluggen16-Nov-12 0:06
memberEddy Vluggen16-Nov-12 0:06 
Questionmessagebeep Pin
Gil Goodridge14-Nov-12 8:00
memberGil Goodridge14-Nov-12 8:00 
AnswerRe: messagebeep Pin
Dave Kreskowiak14-Nov-12 8:31
mvpDave Kreskowiak14-Nov-12 8:31 
QuestionRijndael encryption not working Pin
maskrtnik0114-Nov-12 2:20
membermaskrtnik0114-Nov-12 2:20 
Hi,

I am working on program to be used to process confidential data. That data must be well-encrypted. I have built method, that exports data from memory to XML, encrypts XMl document and saves it to file. But, what seems strange to me is, that encryption method doesn’t work. After its execution, file, which may contain encrypted data is created, but remains empty. I don’ t see any bug in the code. Could you help me to get it working, please?

Here is code used to encrypt and save XML.
Public Sub Save(ByVal carrier As DataCarrier, ByVal password As String, ByVal filename As String)
            Try
                Using sha As New SHA512Managed
                    Dim salt As Byte() = sha.ComputeHash(Encoding.Default.GetBytes(password))
                    Using pdb As New Rfc2898DeriveBytes(password, salt), aes As New RijndaelManaged, filestr As New FileStream(filename, FileMode.Create, FileAccess.Write)
                        Using cryptostr As New CryptoStream(filestr, aes.CreateEncryptor(pdb.GetBytes(32), pdb.GetBytes(16)), CryptoStreamMode.Write)
                            ExportData(carrier).Save(cryptostr)
                        End Using
                    End Using
                End Using
            Catch ex As Exception
                Logging.Instance.WriteException(ex, TraceEventType.Error)
                MessageBox.Show(String.Format(My.Resources.UnhandledExceptionExString, ex.Message, ex.ToString), My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Error)
            End Try
        End Sub

Also, is that encryption algorithm OK, or there is some way to break it? I must be sure that there is no way to break encryption, that is used.
Stanislav Husár

AnswerRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 2:52
mentorKeith Barrow14-Nov-12 2:52 
GeneralRe: Rijndael encryption not working Pin
maskrtnik0114-Nov-12 3:08
membermaskrtnik0114-Nov-12 3:08 
GeneralRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 3:26
mentorKeith Barrow14-Nov-12 3:26 
GeneralRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 3:35
mentorKeith Barrow14-Nov-12 3:35 
GeneralRe: Rijndael encryption not working Pin
maskrtnik0114-Nov-12 3:48
membermaskrtnik0114-Nov-12 3:48 
GeneralRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 4:05
mentorKeith Barrow14-Nov-12 4:05 
QuestionRe: Rijndael encryption not working Pin
maskrtnik0115-Nov-12 19:40
membermaskrtnik0115-Nov-12 19:40 
GeneralRe: Rijndael encryption not working Pin
DisIsHoody14-Nov-12 9:34
memberDisIsHoody14-Nov-12 9:34 
GeneralRe: Rijndael encryption not working Pin
maskrtnik0114-Nov-12 18:21
membermaskrtnik0114-Nov-12 18:21 
AnswerRe: Rijndael encryption not working Pin
DisIsHoody15-Nov-12 17:37
memberDisIsHoody15-Nov-12 17:37 
GeneralRe: Rijndael encryption not working Pin
maskrtnik0115-Nov-12 19:37
membermaskrtnik0115-Nov-12 19:37 
QuestionRetrive date from sql server in system date format in VB6 application by a one time setting Pin
Johnson Antony13-Nov-12 13:34
memberJohnson Antony13-Nov-12 13:34 
AnswerRe: Retrive date from sql server in system date format in VB6 application by a one time setting Pin
Dave Kreskowiak13-Nov-12 14:00
mvpDave Kreskowiak13-Nov-12 14:00 
QuestionHow to find out if a file is in use before reading the data in that file Pin
KreativeKai13-Nov-12 7:47
memberKreativeKai13-Nov-12 7:47 
AnswerRe: How to find out if a file is in use before reading the data in that file Pin
Dave Kreskowiak13-Nov-12 8:09
mvpDave Kreskowiak13-Nov-12 8:09 
GeneralRe: How to find out if a file is in use before reading the data in that file Pin
KreativeKai13-Nov-12 8:22
memberKreativeKai13-Nov-12 8:22 
GeneralRe: How to find out if a file is in use before reading the data in that file Pin
KreativeKai13-Nov-12 8:46
memberKreativeKai13-Nov-12 8:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 26 Aug 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid