String protecting function


This functions help to Protect given string

This functions help to Protect given string



Private Sub getencodedStringFunction()

Dim encoding As New System.Text.ASCIIEncoding()
Dim bytes As Byte() = encoding.GetBytes(textbox1.Text)

textbox2.Text = BytesToString(bytes)

secureData = ProtectMemory(bytes)

End If

TextBox3.Text = BytesToString(secureData)

End Sub

Private Sub getOriginalStringFunction()

Dim bytes As Byte()

bytes = UnprotectMemory(secureData)

Dim encoding As New System.Text.ASCIIEncoding()
TextBox4.Text = RTrim(encoding.GetString(bytes)) ' Trim padding

End Sub


Related Articles

More articles: Decrypt strings Encrypt strings Encryption Decryption

Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: