From: Francis Cianfrocca Date: 2006-10-29T22:02:59+09:00 Subject: Re: symetrical encryption algo's ? ------=_Part_46115_17439986.1162126976297 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/28/06, dc wrote: > > Hi list. > > I need to encode some data with a userID and then also be able to > decode it with the same key. > > This is basically a quick approach to obfuscate URLs. Its for an > environment where we know the users ID with some degree of certainty. > > Are there any libraries/simple algorithms to do this in ruby? it might > be as simple as bitshiting a string around... > > any other suggested alternatives to this approach? > > tx I have a feeling I'm missing something, but if all you want to do is generate obfuscated URLs, why not just the the SHA1-hash of a string consisting of the "real" url and the user's name? You can store the generated urls in the server-side user-session so you don't have to do any decrypting. ------=_Part_46115_17439986.1162126976297--