passwords

Password check- Python 3

不羁岁月 提交于 2019-12-11 17:59:09
问题 Write a function that checks whether a string is valid password. Rules: Must have at least 8 characters A password must consist of only letters and digits A password must contain at least 2 digits Heres what I have so far, what am i doing wrong? thank you def getPassword(): password = input("Enter password: ") return password def validPassword(password): if len(password) >= 8: valid = True if password.alnum(): valid = True if password.isdigit < 2: valid = True else: return False def main():

How to verify a users password for root privledges in python

杀马特。学长 韩版系。学妹 提交于 2019-12-11 17:54:54
问题 I'm attempting to write a python program that requires a the users password to run some external commands using the subprocess libraries. The code is going to look roughly like this. import subprocess passwordInput = raw_input("What is your password: ") subprocess.call('echo ' + passwordInput + ' | sudo -S pacman -Syy', shell=True) This program works fine, however if you enter the incorrect password, the program fails. How would I go about adding some kind of error proofing to detect if the

Mongoose MODEL update() vs save()

隐身守侯 提交于 2019-12-11 17:46:07
问题 There were a question about update() vs save(), but it was targeting some different stuff (I guess, purely related mongoose.Schema methods, but not to the actual document) I have a following scenario, where user logs in to website: I need to load document (find it by userModel.email ) Check if a userModel.password hash matches to what was recieved Update userModel.lastLogin timestamp Append authorization event to userModel.myEvents[] array So I am wondering - what is a proper way to go? 1)

UIWebView doesn't detect text box on website

十年热恋 提交于 2019-12-11 16:57:03
问题 I have a UIWebview that loads the e-mail website for my school. When you log in, you can view and read mail with no problem, but if you goto compose an e-mail or reply to one, you are unable to touch inside the message text box to write your e-mail. I thought it was a problem with the actual e-mail client my school uses, but when I goto the website on Safari I am able to touch in the message box and write an e-mail as usual. If you have any insight on why this would happening, i'd appreciate

php, is there a safe way to store password in cookies?

走远了吗. 提交于 2019-12-11 16:52:41
问题 is there a safe way of storing passwords in cookies in php? or is it not recomended? thanks 回答1: This is not recommended... ... even if encrypted. Storing this information on a client machine gives them the opportunity to compare cookies in the hopes of decrypting. Worse they could sniff a cookie from someone else and then masquerade as that user! What is recommended is having the user login through a secure connection and sending a session cookie in response. The session cookie contains a

mask password string

自闭症网瘾萝莉.ら 提交于 2019-12-11 16:16:32
问题 I'm creating a C# windows forms app that logs me in to my servers with a single click using MSTSC. I have my admin name and password in the code in plain text and wondered is there a way to mask/hide the password? I store my code in my Dropbox and would prefer it wasn't readable. private void RunAsAdmin(string server) { Process rdcProcess = new Process(); rdcProcess.StartInfo.FileName = Environment.ExpandEnvironmentVariables(@"%SystemRoot%\system32\cmdkey.exe"); rdcProcess.StartInfo.Arguments

Password Encryption / Database Layer AES or App Layer AES

微笑、不失礼 提交于 2019-12-11 16:06:32
问题 I need to encrypt / decrypt passwords for a new application. The spec requires me to use AES; can anyone suggest a good reason to either Do all my encryption in the database layer using CLR functions or Doing it at the .Net app layer ? a mixture of db and server Am going to be validation passwords; the app is n-tiered using Telerik ORM. The only real functions are going to be create/ update password and check the entered value. In my gut i think database is better for validating the users

How to verify a PHP hashed password in a NodeJS app

喜夏-厌秋 提交于 2019-12-11 15:22:18
问题 My application ran on PHP for years, and I used the recommended password hashing API as of PHP 5.5 to store my users' passwords. For instance: $password = password_hash("my password", PASSWORD_DEFAULT); As a result, my database is full of passwords such as this: $2y$10$sjzYz7g/kVxpJUynC/...........pjKPh0z1QuU.Mlt7TVAiPW Now I am moving my application to run on NodeJS 12.3.0 instead of PHP and I now use the bcrypt library like this: const saltRounds = 10; const password = await bcrypt.hash("my

Requests s.get(url,verify = False) error [Python]

筅森魡賤 提交于 2019-12-11 14:59:59
问题 I'm attempting to write a program that grabs data from my password protected gradebook and analyzes it for me because my university's gradebook doesn't automatically calculate averages. I'm running into issues at the very beginning of my program and it's growing more and more frustrating. I'm running on Python 2.7.9. This is the Code. import logging import requests import re url = "https://learn.ou.edu/d2l/m/login" s = requests.session() r = s.get(url,verify = False) This is the error that is

devise + capcha + on x wrong passwords?

泪湿孤枕 提交于 2019-12-11 14:09:48
问题 Are there some good resources tutorials or anyone has tried to implement a Capcha on devise when user enters x wrong passwords? The idea is that the capcha shows up on to many requests to prevent bots or other bad guys out and limit the number of requests on the devise signing page. 回答1: I can think of doing that in two ways: The first one is based on failed_attempts attribute (so you should increment it after each unsuccesful login). To use it on Devise, you may create your own FailureApp