Save a password encrypted to app.config?

Posted on 2006-04-22
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 69

    Accepted Solution


    Author Comment

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    758 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now