title: How can I add basic encryption to password?
body: <p>I'm creating a basic sign up form using ruby on rails (I'm relatively new to rails), and what I want to know is how can I encrypt the new user's password (for obvious security reasons)?</p>
  
  <p>Here's my registration page:</p>
  
  <pre><code>&lt;script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
    $.noConflict();
    jQuery(document).ready(function($) {
      $('a.close').click(function(){
        $(this).parent().fadeOut();
      });
    });
  &lt;/script&gt;
  &lt;% if !flash.now[:notice].blank? %&gt;
  &lt;div class="alert-message error"&gt;
    &lt;a class="close" href="#"&gt;×&lt;/a&gt;
    &lt;p&gt;&lt;strong&gt;&lt;%= flash.now[:notice][0] %&gt;&lt;/strong&gt;&lt;/p&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
  &lt;div class="alert-message info"&gt;
    &lt;p&gt;&lt;strong&gt;Join us. It's as simple as 1 2 3.&lt;/strong&gt;&lt;/p&gt;
  &lt;/div&gt;
  &lt;% form_for :user do |f| %&gt;
    &lt;p&gt; Email: &lt;br /&gt;  &lt;%= f.text_field :email %&gt;&lt;/p&gt;
    &lt;p&gt; Name: &lt;br /&gt;  &lt;%= f.text_field :name %&gt;&lt;/p&gt;
    &lt;p&gt; Username:&lt;br /&gt;&lt;%= f.text_field :username %&gt;&lt;/p&gt;
    &lt;p&gt; Password: &lt;br /&gt;  &lt;%= f.password_field :password %&gt;&lt;/p&gt;
    &lt;p&gt; Blog &lt;i&gt;(optional)&lt;/i&gt;: &lt;br /&gt;  &lt;%= f.text_field :blog %&gt;&lt;/p&gt;
    &lt;p&gt;&lt;%= submit_tag "Create User", :disable_with =&gt; "Please wait...", :class =&gt; "btn primary" %&gt;&lt;/p&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>And the User controller:</p>
  
  <pre><code>class UsersController &lt; ApplicationController   
    def register
      @user = User.new(params[:user])
      if(request.post? and @user.save)
        flash[:notice] = "Account Created Successfully"
        redirect_to root_path      
      else
        flash.now[:notice] = @user.errors.full_messages
      end
    end
    def destroy
      @user = User.find(params[:id])
      @user.destroy
      redirect_to root_path
    end  
  end
  </code></pre>
  
  <p>Any help would be appreciated. 
  Thanks in advance.</p>