# Md5 User Registration Form

**URL:** <https://www.ruby-forum.com/t/md5-user-registration-form/149430>\
**Category:** Rails\
**Created:** [September 24, 2008, 7:50pm UTC](https://www.ruby-forum.com/t/md5-user-registration-form/149430 "2008-09-24T19:50:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaosbanane](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chaosbanane](https://www.ruby-forum.com/u/chaosbanane)\
**Post date:** [September 24, 2008, 7:50pm UTC](https://www.ruby-forum.com/t/md5-user-registration-form/149430/1 "2008-09-24T19:50:52Z")

</div>

Hi

I have this tiny problem with the syntax.

I want a registration post form which sends and saves the passwort with  
an MD5 crypt.

So this is the part of the form:

* * *

## \<%= f.password\_field :password %\>

and this is the source to crypt the password:

* * *

## password = params[:password] password = Digest::MD5.hexdigest(password)

But how can I crypt the password before posting?

Greetings Andi

---

<div class="post-metadata">

**Author:** ![chaosbanane](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chaosbanane](https://www.ruby-forum.com/u/chaosbanane)\
**Post date:** [September 25, 2008, 6:59pm UTC](https://www.ruby-forum.com/t/md5-user-registration-form/149430/2 "2008-09-25T18:59:05Z")

</div>

If nobody knows that, mayby someone can tell me how update the :password  
befor saving?

Greetings Andi
