Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Save a password encrypted to app.config?

Posted on 2006-04-22
Medium Priority
Last Modified: 2008-02-26

How can I save a password encrypted to the app.config-File?

The best encryption available...


Question by:Ruttensoft
LVL 70

Accepted Solution

Éric Moreau earned 1500 total points
ID: 16514630

Author Comment

ID: 16514681
Thanks, I've found another solution which is working for me

    Public Shared Function encryptpass(ByVal string_in As String) As String
        Dim DES As New TripleDESCryptoServiceProvider
        DES.Key = KEY_192
        DES.IV = IV_192
        Dim cs As Byte() = DES.EncryptValue _
        Dim f As String = Convert.ToBase64String(cs, 0, cs.Length)
        Return f
    End Function
    Public Shared Function decryptpass(ByVal input As String) As String
        Dim DES As New TripleDESCryptoServiceProvider
        DES.Key = KEY_192
        DES.IV = IV_192
        Dim buffer As Byte() = Convert.FromBase64String(input)
        Dim cs2 As Byte() = DES.DecryptValue(buffer)
        Return ASCIIEncoding.ASCII.GetString(cs2, 0, CInt(cs2.Length))
    End Function

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question