import sha password_plain = "my password" password_encrypted = sha.new(password_plain).hexdigest() print password_encrypted