Displaying 20 results from an estimated 1000 matches similar to: "can we decrypt the cipher encrypted using Digest::SHA1.hexdigest"
2006 Jan 23
3
Encrypt/ Decrypt password
Hi,
I have user add/edit forms.While creating a user I tried the following
method to encrypt password and stored the encrypted password in the
table.
def self.sha1(pass)
Digest::SHA1.hexdigest("#{salt}--#{pass}--")
end
But when I try to edit the page I get the encrypted password in the
password field instead of the decrypted password. Is there any method
to decrypt
2006 Jul 19
6
ActiveRecord::RecordNotSaved - bizarre behaviour.
Hi. I get a RecordNotSaved exception when trying to create a user record.
The error:
User Columns (0.005930) SHOW FIELDS FROM users
SQL (0.000465) BEGIN
SQL (0.000466) COMMIT
ActiveRecord::RecordNotSaved (ActiveRecord::RecordNotSaved):
...
As you can see, there''s no INSERT SQL generated, which is the root cause
of the problem.
In my user model, I have the following
2008 Dec 13
2
Need Help in converting php encryption decryption code to ruby on rails
Hi guys i found this encryption decryption in php and try to convert
it in rails but i am unable to successfully convert it. So plz help
me. I you write the whole conversion code then it will be great.
PHP code is like this
================
#
#/**********************************************
#**
#** MD5 block cypher
#**
#** Author..: leapinglangoor [
2006 Aug 07
2
NoMethod Error: Modifying Location of support modules
I''m trying to follow along with the Agile Development with Ruby on Rails
book and have encountered a problem with code having the following
syntax (partial class provided):
require "digest/sha1"
class User < ActiveRecord::Base
private
def self.hash_password(password)
Digest:SHA1.hexdigest(password)
end
end
I''m getting an error as:
undefined method
2012 Jun 08
2
rubycas-server login fail
Hi all,
I''ve installed Puppet Enterprise 2.5 on Ubuntu 10.04.4 ("minimal" version
on our new hosting provider, previous on amazon ec2 all works fine). So
couldn''t login to puppet dashboard - internal server error. I found problem
in rubycas-server. It fails when try to hash password:
(/opt/puppet/share/rubycas-server/lib/casserver/authenticators/sql_encrypted.rb)
2009 Sep 12
3
Cannot get my password to validate
Hello,
I am working through the railsspace tutorrial, and i''ve noticed that
the password validation is no longer working.
I can get screen_name and email to validate, but for some reason, the
password field is ignored...
here''s what i have so far:
within user.rb file
PASSWORD_MIN_LENGTH = 4
PASSWORD_MAX_LENGTH = 40
validates_length_of :password, :within =>
2009 Nov 09
4
Decrypt a admin password (with salt)
Hello,
I want decrypt a password which is encrypted by MD5.
there are 4 functions which i am using :
# Encrypts some data with the salt.
def self.encrypt(password, salt)
Digest::SHA1.hexdigest("--#{salt}--#{password}--")
end
# Encrypts the password with the user salt
def encrypt(password)
self.class.encrypt(password, salt)
end
def authenticated?(password)
2006 Apr 21
1
Catch authentication result from a model in a controller
Im still following the authorization recipe from the book, now all works
fine but im getting trouble in how handle the model authorization
result, if the user and pass are correct, it goes to a welcome
screen(admin.rhtml) but if wrong the model prints a message in an ugly
exception like page "usr and pass not correct", i want to redirect the
user to the login
2007 Nov 17
18
Syntax Problem
I admit I am stuck. I am converting a legacy php site to ROR. The old
site uses MD5, a security flaw waiting to happen. I upgraded to AAA
and am adding code in the session_controller.rb file to see if
crypted_password is blank. If it is, crypt and check the password
against the old md5 version and write it in the new crypted_password
field.
Here is my code add on before the logged_in?:
def
2006 Aug 07
2
Bind variables error
wrong number of bind variables (0 for 2) in: first_name = ? AND last_name = ?
I''m not sure why I"m getting this error ?
def self.authenticate(first_name, last_name, password)
user = User.find(:first, :conditions => [''first_name = ? AND
last_name = ?''])
if user.blank?
Digest::SHA256.hexdigest(password + user.password_salt) !=
user.password_hash
2006 Aug 07
3
wrong number of bind variables
I''m getting this error message since i moved alot of the database
logic to the model.
wrong number of bind variables (0 for 2) in: first_name = ? AND last_name = ?
def self.authenticate(first_name, last_name, password)
user = User.find(:first, :conditions => [''first_name = ? AND
last_name = ?''])
if user.blank?
Digest::SHA256.hexdigest(password +
2010 May 10
6
de-crypting Ruby password with php.
Hello all, I have a client with an older Rails 1.8 app (was recently
upgraded from 1.6) and I need to integrate a php site to use the same
user login creds.
I''m not very versed with Ruby but I think this is the code that
encrypts the password.
[code]
# Encrypts some data with the salt.
def self.encrypt(password, salt)
Digest::SHA1.hexdigest("--#{salt}--#{password}--")
2016 Feb 03
2
Python hashlib and ripemd160
Hi - I think the patent monster has struck again.
rmd = hashlib.new('ripemd160',binascii.unhexlify(someString)).hexdigest()
That fails - ValueError: unsupported hash type
From some googling, it appears that the supported hash types are from
OpenSSL and that means the OpenSSL in CentOS doesn't support ripemd160.
I've worked around other stuff missing from CentOS OpenSSL by
2006 Nov 16
1
Assigning to results - missing something
Hi,
I''m trying to convert an app to use 0.2.0, and having a little trouble
understanding how to use the results hash.
Formerly my worker had an instance variable, @file_stats which was
initialized to an empty hash; I have replaced @file_stats with
results[:file_hash]. Actually my initial pass at this was just to do a
s/@file_stats/results[:file_hash]/. Which gets me the following:
2006 Feb 15
8
Agile book - getting confusing error
Working through the beginning phase from the Agile book on
''Administration''
undefined method `hashed_password='' for #<User:0xb7911324>
...
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1498:in `method_missing''
#{RAILS_ROOT}/app/models/user.rb:12:in `before_create''
2015 Jun 30
2
how is the sha fingerprint generated?
You really don't need openssl for that.
And the fingerprints are simple.
Here is a python script that do the same as ssh-keygen
-fl /path/to/key :
#!/usr/bin/env python3
import binascii
import hashlib
import sys
if __name__ == "__main__":
key = binascii.a2b_base64(sys.argv[1])
if sys.argv[2] == "md5":
m = hashlib.new("md5")
2007 Mar 30
7
Some additional attacks on Cookie Session
Aside from the replay attacks discussed, there are some other attack
vectors on the cookie_session store.
I appreciate (and admire!) Jeremy''s good humor on all of this:
> Planting the seed here led to quick ripening and plenty of pesticide.
> Thanks for the fish, all.
>
> jeremy
Anyway, here''s what we came up with:
1. Brute Force
SHA512 can be computed _very_ fast.
2004 Dec 08
3
SHA1
Hi,
I am currently installing doveot as POP and IMAP server, but I a have
a few difficulties configuring it correctly.
I use postgresql to store the user information. The passwords are
stored SHA1 encrypted. Now I have the problem that dovecot isn't
accepting the user. In dovecot-pgsql.conf I defined
default_pass_scheme = SHA1
I am not quite sure about whether this is corrents, since it
2007 Jun 15
3
Simplest way to encrypt / decrypt a string?
I have done multiple google searches and searched the mailing list. All
of the solutions I found seemed kind of heavy / complicated. I just want
a very simple way to encrypt and decrypt a string. Something like:
encrypt("fdsfdsfdsf", "some key");
decrypt("fdsfdsfsdf", "some key");
Is this possible?
Thanks for your help.
--
Posted via
2006 Mar 04
4
Two quick newbie questions
2 quick questions regarding authentication ...
1) the flash[:notice] on successful login looks completely wrong to me.
How should it be done?
def index
if request.post?
@user = User.new(params[:user])
authentic_user = @user.attempt_login
if authentic_user
session[:user_id] = authentic_user.id
flash[:notice] =
''Login successful! Welcome