Support Forums

Full Version: VB.NET Base64 Encode/Decode [SRC]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Heres how to encode and decode with Base64 in only two lines of code..

Under "Encode" button
Code:
TextBox1.Text = Convert.ToBase64String(New System.Text.ASCIIEncoding().GetBytes(TextBox1.Text))

Under "Decode" button
Code:
TextBox1.Text = New System.Text.ASCIIEncoding().GetString(Convert.FromBase64String(TextBox1.Text))

Thought this may come in handy for some..
Wow! I made one from this! This helped me out!! Thanks Smile
Thanks!

I'm working on an ipod touch app and this will be a part of it!
very simple but dose the gob. good work
Thanks for the share Fragama, will come in very handy.
Big thanks for this, this will be useful.
That's very useful. Nice share.
Thank you, it works fine. Smile
This is ideal for encoding simple strings that you don't want prying eyes to catch right away. However, always keep in mind that an experienced programmer/someone with malicious intent could easily decode base64, as it's not based around any sort of encryption key.

If you were interested in looking into more advanced forms of encryption, may I suggest AES-256 (Rijndael)?
I can see this being used in a few applications.
Pages: 1 2