def create_account(cls, name, account, password, avatar=None, email=None):
     n = cls()
     n.name = name
     n.account = account
     n.password = bcrypt.hashpw(password, bcrypt.gensalt())
     n.avatar = avatar
     if email:
         n.email = email
     n.put()
     return n
예제 #2
0
 def hash(cls, password):
     return bcrypt.hashpw(password, bcrypt.gensalt())
예제 #3
0
def make_pw_hash(name, password):
    hashed = bcrypt.hashpw(name + password, bcrypt.gensalt())
    return hashed
예제 #4
0
	def hash_pwd(self, pwd):
		self.pwd = bcrypt.hashpw(pwd, bcrypt.gensalt(1))
예제 #5
0
파일: functions.py 프로젝트: breising/blog
def make_bcrypt_hash(password):
    '''
    checks the authenticity of the submitted password against a hash
    '''
    return bcrypt.hashpw(password, bcrypt.gensalt(2))
예제 #6
0
def make_pw_hash(name, password):
    hashed = bcrypt.hashpw(name + password, bcrypt.gensalt())
    return hashed
예제 #7
0
def make_pw_hash(name, pw, salt = bcrypt.gensalt(5)):
    h = bcrypt.hashpw(str(name + pw + salt), salt)
    return '%s|%s' % (salt, h)
def secure_cookie(cookie_val,n_salt=2):
    try:
        bcr_hash= bcrypt.hashpw(cookie_val, bcrypt.gensalt(n_salt)).split('$')[-1]+ '.'+cookie_val
        return bcr_hash
    except:
        return None
def secure_pw(pw,n_salt=2):
    try:
        return bcrypt.hashpw(pw, bcrypt.gensalt(n_salt)).split('$')[-1]
    except:
        return None
def secure_pw(pw, n_salt=1):
    return bcrypt.hashpw(pw, bcrypt.gensalt(n_salt)).split('$')[-1]
예제 #11
0
def hash_password(password):
    return bcrypt.hashpw(password, bcrypt.gensalt())
 def bycrypt_password(self):
     self.password = u'' + bcrypt.hashpw(u'' + self.password, bcrypt.gensalt())
     self.put()
 def bycrypt_password_with_old_password(self):
     if self.old_password != self.new_password:
         self.password = u'' + bcrypt.hashpw(u'' + self.new_password, bcrypt.gensalt())
         self.put()
예제 #14
0
def hashText(text, iters = 2):
	'''Returns a hexhash of the text using bcrypt for n iterations'''
	# I don't actually know how reliable python bcrypt is
	# But compiled version is not an option with GAE
	return bcrypt.hashpw(text, bcrypt.gensalt(iters)).encode('hex')
예제 #15
0
	def encrpytPassword(self,password):
		return hashpw(password, gensalt());