Skip to content

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

fLock

Lock any folder on your Mac behind a password — built entirely on macOS's own encryption (hdiutil). No installer, no dependencies, no account.

fLock icon

How it works

A folder is either open or locked — never both. Locking seals it into an encrypted Name.flock file and removes the original folder; unlocking reverses that exactly, deleting the .flock file and restoring the folder.

 [ folder ]  --lock-->  [ Name.flock ]
 [ folder ]  <--unlock--  [ Name.flock ]

No cryptography was hand-rolled: lockfolder calls hdiutil create -encryption AES-256 — the same tech behind encrypted macOS backups — and applies macOS's own padlock icon to the result via NSWorkspace, so a locked file is visually obvious in Finder.

Install

  1. Download this repo — either git clone it, or click Code → Download ZIP on GitHub and unzip it.
  2. Open Terminal and go to the folder:
    cd ~/Downloads/fLock-main   # or wherever you put it
    
  3. Make the scripts runnable:
    chmod +x build.sh lockfolder tests/test_lockfolder.sh
    
  4. Build the app:
    ./build.sh
    
    This creates fLock.app right there in the folder.
  5. (Optional) confirm it actually works:
    ./tests/test_lockfolder.sh
    
    Should print PASS.
  6. Move it somewhere permanent:
    mv fLock.app ~/Desktop/
    
  7. First launch: double-click it (or drag a folder onto it). macOS will say it's from an "unidentified developer" — right-click the app → Open → confirm. This only happens once.

Use it

  • Lock: drag a folder onto fLock.app → set a password → the folder becomes Name.flock.
  • Unlock: drag Name.flock onto fLock.app → enter the password → it becomes the original folder again, with "Reveal in Finder" on offer.
  • No drag? Double-click fLock.app with nothing dropped on it — it asks "Lock a Folder" or "Unlock a File" and opens a normal file picker.
  • Terminal, no GUI: ./lockfolder lock <folder> / ./lockfolder unlock <file.flock>.

Files

File What it is
lockfolder The actual logic — bash + hdiutil + a small AppleScript snippet for the icon. Works standalone.
fLock.applescript Source for the GUI wrapper (drag-and-drop, dialogs, file pickers).
build.sh Compiles fLock.applescript into fLock.app, bundles lockfolder inside it, applies the icon.
tests/test_lockfolder.sh Round-trip self-test: locks a folder, unlocks it, checks the contents match.

Run the test after any change to lockfolder:

./tests/test_lockfolder.sh

Compatibility

Works on any Mac — Apple Silicon or Intel, any recent macOS. Copy just fLock.app to another Mac (or send the zipped .app) and it works unchanged; each new Mac shows the same one-time "unidentified developer" warning on first launch.

Does not work on Windows or Linux — it relies on macOS-only tools (hdiutil, AppleScript). On Windows, BitLocker To Go is the closest native equivalent.

About

Lock any macOS folder behind a password using native encrypted disk images — no installer, no dependencies

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages