The logic on the opposite end of that would look like this:
Dim base64Encoded As String = Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(plainText))
As mentioned in the comments above, though, ASCII will only work for a small set of (mostly English) characters, so if you need it to handle any string, it would be better to use Encoding.Unicode
. Also, base-64 is just a different encoding scheme. It is not an encryption method. Most technically inclined people would recognize that it's base-64 and be able to decode it easily. If that's not an issue, that's fine, but if you really want to make it secure, you need to use an actual encryption algorithm, such as AES.