Hiding Strings

Blitz3D Forums/Blitz3D Beginners Area/Hiding Strings

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hey whats a good way of hiding stings in data packets and files?

Right now Im just shifting each value 1 bit left to save and one bit right to read. Its fairly fast and hard to read but easy to crack. any suggestions? Remember any solution has to be FAST. Thanks!


Here's the code I'm using:
Function write_string(file, txt$)
	x$ = string_shiftl(txt, 1)
	WriteString file, x
End Function

Function read_string(file)
	txt$ = ReadString(file) 
	Return string_shiftr(txt, 1)
End Function

Function string_shiftl$(txt$, start)
	l = Len(txt)
	If start > l Then 
		Return ""	
	Else
		Return Chr(Asc(Mid(txt, start, 1)) Shl 1) + string_shiftl(txt, start + 1)
	EndIf
End Function

Function string_shiftr$(txt$, start)
	l = Len(txt)
	If start > l Then 
		Return ""	
	Else
		Return Chr(Asc(Mid(txt, start, 1)) Shr 1) + string_shiftr(txt, start + 1)
	EndIf
End Function