# Acts as Authenticated

**URL:** <https://www.ruby-forum.com/t/acts-as-authenticated/103693>\
**Category:** Rails\
**Created:** [May 9, 2007, 11:49am UTC](https://www.ruby-forum.com/t/acts-as-authenticated/103693 "2007-05-09T11:49:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [May 9, 2007, 11:49am UTC](https://www.ruby-forum.com/t/acts-as-authenticated/103693/1 "2007-05-09T11:49:59Z")

</div>

Hi,

Can anyone tell me the hash encryption level for a password using acts  
as authenticated 128bit, 164bit???

require ‘digest/sha1’

# Encrypts some data with the salt.

def self.encrypt(password, salt)  
Digest::SHA1.hexdigest("–#{salt}–#{password}–")  
end

JB

---

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [May 9, 2007, 12:12pm UTC](https://www.ruby-forum.com/t/acts-as-authenticated/103693/2 "2007-05-09T12:12:11Z")

</div>

Correct me if I’m wrong, imho it doesn’t have an encryption level  
since hashing is one-way…  
A sha1 hash is 40 alnum characters (160 bit) long.

Sincerely  
Florian

Am 09.05.2007 um 11:49 schrieb John:
