How to create Folder Lock with Password Protected using Python


Python Blog #Author: ManishHacker1

Hello guys, Today we will be learn how to create folder lock with password protected using Python programming language.

What is Folder Lock?

Folder Lock is a data security software that is allows its users to encrypt thier files and folder. Lock, hide and password protects files and folder on your computer. You can use Folder Lock to secure your files and folder on windows.

So, I am going to tell you how to make your own Folder Lock, without using any software.

Pre-Reuisites:

You will need only pyhton installed in your operating system. if you want to distribute your Folder Lock then you will be also need pyinstaller using to convert our python file to .exe file.

Compatibility:

Compatible with any Microsoft Windows Operating system.

Instructions:

First open your python IDE or Notepad, where you want to write code. If you use to notepad please remember indentation using to write code.
Or copy the following code and paste in your python IDE or Notepad and save as anyname.py. Where ".py" is our file extension.

Step For Coding

Full code:


#Aythor : ManishHacker1
#Follow on FB: https://www.facebook.com/ManishHacker1
#Follow on Insta: https://www.instagram.com/manishhacker19889/
#Follow on Insta: https://www.instagram.com/krypsec
#Follow on Insta: https://www.instagram.com/kryptora
import base64
import os
import time
import sys

pw = "password"   #Dedault Password
encode = base64.b64encode(pw)

def goto(linenum):
    global line
    line = linenum

line = 1
while True:
    pw = str(raw_input("Enter your password for Lock or Unlock your folder: "))

    if pw == base64.b64decode(encode):
    # Change Dir Path where you have Locker Folder
        os.chdir("F:\Studend\Python\Advanced\Password")
    # If Locker folder or Recycle bin does not exist then we will be create Locker Folder 
        if not os.path.exists("Locker"):
            if not os.path.exists("Locker.{645ff040-5081-101b-9f08-00aa002f954e}"):
                os.mkdir("Locker")
            else:
                os.popen('attrib -h Locker.{645ff040-5081-101b-9f08-00aa002f954e}')
                os.rename("Locker.{645ff040-5081-101b-9f08-00aa002f954e}","Locker")
                sys.exit()
        else:
            os.rename("Locker","Locker.{645ff040-5081-101b-9f08-00aa002f954e}")
            os.popen('attrib +h Locker.{645ff040-5081-101b-9f08-00aa002f954e}')
            sys.exit()
        
    else:
        print "Wrong password!, Please Enter right password"
        time.sleep(5)
        goto(1)

The above code have dafault password is "password". If you want to set your own desired password then change password. In my code my dafult password is "password".

How to use:

After that run your code and enter your default password. This will be create a Locker Folder in your drive where you want to create. If you want to create Locker folder in your "F:\" drive then change directory path in our code. In my case, My directory path is "F:\Studend\Python\Advanced\Password". Where my Locker folder is created.

After that put your secret file and folder in your Locker Folder and again run your code. Voilaaa!!!

This code will be create password protected folder and also become convert in recyle bin. After that certainly automatically will hide in your hard-drive.If you want unlock your Locker Folder. Again run your code and enter your desired password. If password is correct then you can access your secret files and folder.

Now the Deploy

Well, we have done all work for Folder Lock. Now we are going to use pyinstaller to convert it to an exe file so we can easily run it on their computer.

Now, We will be download pyinstaller using pip. Open your command prompt and type:


c:\Users\Administrator>cd\      and hit enter
c:\>cd Python27      and hit enter
c:\Python27>cd Scripts     and hit enter
c:\Python27\Scripts>pip install pyinstaller         and hit enter

After installation pyinstaller, Go to your program’s directory and run:

pyinstaller Locker.py --onefile --noconsole --ico=anyimage.ico keylogger.py

  • --onefile -> to make it just a single executable
  • --noconsole -> to prevent a console window from popping up
  • --ico -> .ico image to make it more convincing

Note:

Important think is that, you can run your script from any location in your computer where you want.

Thank You for reading this article.I hope you enjoyed it. If any query please comment. And also like my FB page givin below link and share it.

Kryptora Digital Security Provided Python Training and Ethical Hacking Training
  • Best Python Training in Noida
  • Best Python Training in Delhi
  • Best Python Training in Meerut
  • Best Python Training in India
  • Best Ethical Hacking Training in Noida
  • Best Ethical Hacking Training in Delhi
  • Best Ethical Hacking Training in Meerut
  • Best Ethical Hacking Training in India

Follow ManishHacker1

Comments

Post a Comment

Popular posts from this blog

TOP 10 ANIMATED BATCH FILE PROGRAM

How to Connect Window Machine to Linux Machine Using Python via SSH