Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

App lock in python

Hello programmers, i had a question for those who are experienced with python, is it possible to make an "app lock" with python. i'm thinking onstart load python file with the lock and if the password is correct open the file, else, don't. So is it possible, or should i use some other language? 

Link to post
Share on other sites
37 minutes ago, Zuccers said:

Thinking of something like this:
 


inport time
print("Where you going comrade?")
Username = ("A" "a");
Password = ("B" "b");
inputUser = input("Username: ");
inputPass = input("Password: ");
if inputUser == Username:
print ("")
else:
print("No, no, no");
time.sleep(5);
quit()
if inputPass == Password:
print ("Ah, welcome back boss");
time.sleep(5);
else:
print("What now?Get out of here");
time.sleep(5);
quit()

 

 

Link to post
Share on other sites

Problem is most people can figure out your password just by looking at your python script. 

Sudo make me a sandwich 

 

Check out my guide on creating your own private cloud storage

 

Link to post
Share on other sites
1 hour ago, wasab said:

Problem is most people can figure out your password just by looking at your python script. 

Could just use a salted hash. Far from a perfect solution, but they'd still have to brute force the PW from scratch after opening the script ¯\_(ツ)_/¯

Gaming build:

CPU: i7-7700k (5.0ghz, 1.312v)

GPU(s): Asus Strix 1080ti OC (~2063mhz)

Memory: 32GB (4x8) DDR4 G.Skill TridentZ RGB 3000mhz

Motherboard: Asus Prime z270-AR

PSU: Seasonic Prime Titanium 850W

Cooler: Custom water loop (420mm rad + 360mm rad)

Case: Be quiet! Dark base pro 900 (silver)
Primary storage: Samsung 960 evo m.2 SSD (500gb)

Secondary storage: Samsung 850 evo SSD (250gb)

 

Server build:

OS: Ubuntu server 16.04 LTS (though will probably upgrade to 17.04 for better ryzen support)

CPU: Ryzen R7 1700x

Memory: Ballistix Sport LT 16GB

Motherboard: Asrock B350 m4 pro

PSU: Corsair CX550M

Cooler: Cooler master hyper 212 evo

Storage: 2TB WD Red x1, 128gb OCZ SSD for OS

Case: HAF 932 adv

 

Link to post
Share on other sites
6 minutes ago, reniat said:

Could just use a salted hash. Far from a perfect solution, but they'd still have to brute force the PW from scratch after opening the script ¯\_(ツ)_/¯

Problem is, most people can also edit the script so it doesn't require password....

Sudo make me a sandwich 

 

Check out my guide on creating your own private cloud storage

 

Link to post
Share on other sites

If you are on Unix/Unix like os, you just need to restrict program/file execute permission to root only. You don't need to create something on your own to do this. Doesn't windows have similar stuff? What is it called? User control or something I think

 

Sudo make me a sandwich 

 

Check out my guide on creating your own private cloud storage

 

Link to post
Share on other sites
2 minutes ago, wasab said:

Problem is, most people can also edit the script so it doesn't require password....

.....................

I'm gonna blame the fever on this one.

Gaming build:

CPU: i7-7700k (5.0ghz, 1.312v)

GPU(s): Asus Strix 1080ti OC (~2063mhz)

Memory: 32GB (4x8) DDR4 G.Skill TridentZ RGB 3000mhz

Motherboard: Asus Prime z270-AR

PSU: Seasonic Prime Titanium 850W

Cooler: Custom water loop (420mm rad + 360mm rad)

Case: Be quiet! Dark base pro 900 (silver)
Primary storage: Samsung 960 evo m.2 SSD (500gb)

Secondary storage: Samsung 850 evo SSD (250gb)

 

Server build:

OS: Ubuntu server 16.04 LTS (though will probably upgrade to 17.04 for better ryzen support)

CPU: Ryzen R7 1700x

Memory: Ballistix Sport LT 16GB

Motherboard: Asrock B350 m4 pro

PSU: Corsair CX550M

Cooler: Cooler master hyper 212 evo

Storage: 2TB WD Red x1, 128gb OCZ SSD for OS

Case: HAF 932 adv

 

Link to post
Share on other sites

If you want to password protect the file then the password should be applied to the file not the python script, aka encrypt the file and use python to decrypt and encrypt once you're done.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to post
Share on other sites
11 hours ago, wasab said:

If you are on Unix/Unix like os, you just need to restrict program/file execute permission to root only. You don't need to create something on your own to do this. Doesn't windows have similar stuff? What is it called? User control or something I think

 

 

11 hours ago, reniat said:

.....................

I'm gonna blame the fever on this one.

 

6 hours ago, vorticalbox said:

If you want to password protect the file then the password should be applied to the file not the python script, aka encrypt the file and use python to decrypt and encrypt once you're done.

Um, let's take chrome as an example, you would need to lock the file, so i guess implement it in the script, somewhere near the part of log on/turn on part and if passpord == password; then continue :)

Link to post
Share on other sites
import os
while True:
    password = input("Comrade, where are you trying to go? Tell me the darn password")
    if password == "abc321":
        print ("Welcome boss!")
        chrome = "start chrome"
        os.system(chrome)
        break
    else:
        print("No, no, no")

Something like this :)

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×