Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

How to generate encrypted_password? (Building the Friendship UI - Integration Testing Friendships)

In the video ( Building Social Features in Ruby on Rails - Building the Friendship UI - Integration Testing Friendships), Jason created the encrypted_password, but there was no instruction to make one.

How can I create a encrypted_password?

3 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Yuichi,

Add this line to your users.yml fixture:

  encrypted_password: "$2a$10$Fh/Hm8RxDsuPTeBUr6864.GARlcmt7zF2WspaXGr3BIv2C27N.osq"

Thank you, but I was curious, if I want to generate an encrypted password like this, how can I create one?

Itay Banner
Itay Banner
1,922 Points

Hi Jason Seifer

If I remember correctly the password is supposed to be encrypted using the MD5 algorythm. If so, I used an MD5 Hash Generator for the string 'testing', but the hash came out different...:

ae2b1fca515949e5d54fb22b8ed95575