# Query string encryption

**URL:** <https://www.ruby-forum.com/t/query-string-encryption/186929>\
**Category:** Rails\
**Created:** [April 14, 2010, 2:51pm UTC](https://www.ruby-forum.com/t/query-string-encryption/186929 "2010-04-14T14:51:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![turnkeytraders](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ba8739/32.png) [@turnkeytraders](https://www.ruby-forum.com/u/turnkeytraders)\
**Post date:** [April 14, 2010, 2:51pm UTC](https://www.ruby-forum.com/t/query-string-encryption/186929/1 "2010-04-14T14:51:07Z")

</div>

Hello,

I’m using crypt/rijndael to encrypt data being sent through an HTTP  
POST.

Before I send my encrypted string this is what I do:

rijndael = Crypt::Rijndael.new(key)  
crypt = rijndael.encrypt\_string(“test”)  
escaped\_crypt = CGI::escape(crypt)

Then I send the encrypted data to my web service. On my web service, I  
do this:

rijndael.decrypt\_string(CGI::unescape(params[blah]))

If I do that, it doesn’t decrypt my string, it stays encrypted, I made  
sure to have the same key on my web service but it still doesn’t decrypt  
the string. Is there something specific I need to check for concerning  
the encoding?

Thanks  
M
