VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

EnHex / DeHex

Jamie Richard Wilson  (2 Submissions)   Encryption   Visual Basic 3.0   Beginner   Wed 3rd February 2021

EnHex converts a string to hexidecimal characters, which I designed for use with encryption routines that sometimes output unprintable characters. It's a simple way to convert unprintable characters into something printable. DeHex simply reverses the process.

Inputs
EnHex Input: normal text DeHex Input: text that has been "en-hexed"

Assumes
The assumption is that any text sent to DeHex is in fact hexidecimal. I pulled this from my own personal coding toolbox so I haven't built in any error checking because it was written for use in a very controlled environment -- such as apps I've written that use encryption.

Returns
EnHex Return: text converted into hexidecimal characters DeHex Return: the original text that was converted to hexidecimal characters using EnHex

Side Effects
Converting a string into hexidecimal format will effectively double the size of the string (hexidecial requires two characters for every "en-hexed character), so be sure to weigh the benefits of having printable text against the size of the result. I tend to only use this if I need to send encrypted data blocks through email or if I want a user to manually enter small amounts of encrypted data, such as a one-line registration number.

Rate EnHex / DeHex (7(7 Vote))
EnHex / DeHex.bas

EnHex / DeHex Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters