How to use before_filter to decrypt post data

hello, everybody.
in ror, we can add a after_filter to a controller.

def aes_encrypt
response.body = AesHelper.aes_encrypt(response.body)

after_filter :aes_encrypt

and all action’s repsonse int the controller can be encrypt.

and my question is , how to decrypt data use before_filter, or anything

ex: i want to post json data to /usr/register, the json data is
{“name”:“good”, “password”:“nice”}. encrypt it to

so i post
to /usr/register

in action register , i would write code like this:

already decrypt.

def register
User.register(params[:name], params[:passport])

so, how can i decrypt
5B2YC7WzgFmaivnATP1ZLR4sTXB3SsWEUeMpUbcYiylcvHxfSStYIBqwIMCjZAY3 before
action register to use params directly in register

thanks for anybody’s help!!
you’ll get a clear description about how to use Filters.

Best Regards,
Ryan Cheung