Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Roedy Green Newsgroups: comp.lang.java.programmer Subject: Re: Simple alphanumeric "encryption"? Date: Thu, 20 Oct 2011 13:32:41 -0700 Organization: Canadian Mind Products Lines: 31 Message-ID: <4811a7lih422b903mhsv0s1clhrrba0dv2@4ax.com> References: Reply-To: Roedy Green NNTP-Posting-Host: Z2l1DcCELS0rATq8NqV4Sw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 6.00/32.1186 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9052 On Mon, 17 Oct 2011 18:16:48 +1100, "Qu0ll" wrote, quoted or indirectly quoted someone who said : >I need to be able to encrypt/code an arbitrary string of up to about 50 >alphanumeric characters into a string that also contains only alphanumeric >characters. All of the encryption algorithms I have looked result in >strings with non-ASCII characters in them (when the resulting bytes are >turned into a string) which is not suitable. > >Is there a simple way to do this? It must be able to successfully be >decrypted as well but doesn't need to be very sophisticated or extremely >secure. Cheapie encryption XOR with a password then XORs again to get it back. You need to armour the encrypted bytes. See http://mindprod.com/jgloss/armour.html for various techniques. The simplest is convert to hex. you have to strip the armour before decryption. -- Roedy Green Canadian Mind Products http://mindprod.com It should not be considered an error when the user starts something already started or stops something already stopped. This applies to browsers, services, editors... It is inexcusable to punish the user by requiring some elaborate sequence to atone, e.g. open the task editor, find and kill some processes.