DEV Community

Akhouri Anmol Kumar
Akhouri Anmol Kumar

Posted on

πŸ”’ I Stopped Testing ATLOCK by Asking β€œDoes It Work?”

A security feature working once is not very interesting.

The more important question is:

What happens when everything goes wrong?

That's the question that changed how I test ATLOCK v4, my Windows security suite.

πŸš€ Try ATLOCK v4:
https://github.com/Akhouri-Anmol-Kumar/ATLOCK

The Happy Path Is Easy

Most application testing starts like this:

Input
↓
Function
↓
Expected Result
↓
βœ… PASS

For example:

Enter correct password
↓
Vault unlocks
↓
Success

Great.

But security software doesn't live exclusively on the happy path.

Real systems look more like:

             REQUEST
                β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚                   β”‚
   SUCCESS              FAILURE
      β”‚                   β”‚
      β–Ό                   β–Ό
  Continue          What happens now?
                          β”‚
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β–Ό         β–Ό         β–Ό
             Retry      Abort    Recover
Enter fullscreen mode Exit fullscreen mode

That last branch is where things get interesting.

πŸ§ͺ 1. Password Vault: What If Authentication Fails?

ATLOCK's Password Vault uses:

Fernet
PBKDF2-HMAC-SHA256
200,000 PBKDF2 iterations

The obvious test is:

Correct password β†’ vault opens.

But that's only one test.

I also care about:

Wrong password
↓
Authentication failure
↓
Vault remains locked
↓
No plaintext data exposed
↓
User receives clear feedback

The important security property isn't merely that the correct password works.

It's that the incorrect password doesn't accidentally produce an unsafe state.

πŸ” Cryptography Doesn't Remove Application-Level Bugs

This is something I think developers sometimes overlook.

You can use a strong cryptographic primitive and still build insecure application logic around it.

Conceptually:

         CRYPTOGRAPHY
              β”‚
              β–Ό
      Protects the data
              β”‚
              β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ Application Logic   β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”
      β–Ό               β–Ό
   Correct           Bug
      β”‚               β”‚
      β–Ό               β–Ό
  Safe flow       Unsafe flow
Enter fullscreen mode Exit fullscreen mode

Using encryption doesn't automatically make everything surrounding it secure.

You still have to think about:

key derivation
authentication
input handling
state management
error handling
file handling
memory handling
access control

That's why security engineering is much bigger than choosing an encryption algorithm.

πŸ›‘οΈ 2. File Guard: Permissions Can Fail

ATLOCK's File Guard works with NTFS ACLs.

The normal workflow is simple:

Select file
↓
Apply protection
↓
ACL changes
↓
File becomes protected

But Windows doesn't guarantee that every permission operation will succeed.

There can be:

insufficient privileges
unusual ownership
inherited permissions
conflicting ACL entries
filesystem issues
invalid targets
unexpected Windows configurations

So the real workflow needs to account for:

             ACL OPERATION
                  β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
         β–Ό                 β–Ό
      SUCCESS             FAIL
         β”‚                 β”‚
         β–Ό                 β–Ό
    New state         Error handling
                           β”‚
                           β–Ό
                     User feedback
Enter fullscreen mode Exit fullscreen mode

The dangerous assumption would be:

β€œThe function returned, therefore the security operation succeeded.”

No.

The resulting system state is what matters.

🧠 3. State Matters More Than Buttons

One of the biggest changes in my thinking was moving from:

β€œDoes this button work?”

to:

β€œWhat state is the application in after this button is pressed?”

For example:

LOCKED
β”‚
β”‚ correct authentication
β–Ό
UNLOCKED

But what about:

LOCKED
β”‚
β”‚ wrong authentication
β–Ό
LOCKED

That's obvious.

Now consider:

LOCKED
β”‚
β”‚ unexpected exception
β–Ό
???

That ??? is where testing becomes useful.

A security application should have defined failure states, not accidental ones.

πŸ“Έ 4. Intruder Ops: Hardware Is Unpredictable

Intruder Ops introduced another category of failure:

external hardware.

ATLOCK uses OpenCV's:

cv2.VideoCapture

for webcam access.

The basic concept is straightforward.

The real world isn't.

The camera might:

Camera requested
β”‚
β”œβ”€β”€ Camera available
β”‚ ↓
β”‚ Capture
β”‚
β”œβ”€β”€ Camera busy
β”‚ ↓
β”‚ Failure
β”‚
β”œβ”€β”€ Camera missing
β”‚ ↓
β”‚ Failure
β”‚
└── Initialization problem
↓
Failure

A security event shouldn't turn into:

Application stopped responding.

That's why hardware-dependent operations need to be treated as potentially slow and failure-prone.

⚑ 5. Don't Let Security Operations Freeze the UI

This became one of the practical lessons from working with webcam capture.

Imagine:

Security Event
↓
Initialize Camera
↓
Wait...
↓
Wait...
↓
UI freezes

That's terrible UX.

And it's especially bad in security software because the application may be trying to respond to the very event that caused the operation.

The better architecture is conceptually:

            SECURITY EVENT
                  β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
         β–Ό                 β–Ό
    UI / State          Capture Task
         β”‚                 β”‚
         β”‚                 β–Ό
         β”‚             Camera I/O
         β”‚                 β”‚
         β–Ό                 β–Ό
    Responsive UI       Result
                           β”‚
                           β–Ό
                      Local Storage
Enter fullscreen mode Exit fullscreen mode

The exact implementation details matter, but the principle is simple:

Slow external operations shouldn't unnecessarily block the main interface.

πŸ”Š 6. What If the Alert System Fails?

Another easy assumption:

Intrusion event
↓
Play alarm
↓
Done

But audio is also an external dependency.

What if:

audio is disabled?
the device isn't available?
the configured sound can't be loaded?
the user has changed the output device?

A security workflow shouldn't collapse just because an optional notification mechanism failed.

So I think about alerts as:

Security Event
β”‚
β”œβ”€β”€ Audio
β”‚
β”œβ”€β”€ Notification
β”‚
└── Evidence

rather than:

Security Event β†’ ONE action

That distinction makes the overall system more resilient.

πŸ’» 7. Portable Software Creates Its Own Testing Problems

ATLOCK is designed as a portable Windows application.

That's convenient for users.

But portability means I can't assume:

My machine = User's machine

A user's environment might have:

different Windows configuration
different permissions
different hardware
different camera devices
different audio devices
different filesystem contents
different security policies

So every assumption about the environment is potentially a test case.

🧩 8. The β€œWorks on My PC” Problem

This is probably one of the oldest software problems.

Developer:

β€œIt works perfectly.”

User:

β€œIt doesn't.”

Both can be correct.

Because:

Developer Environment
β‰ 
User Environment

For ATLOCK, that difference matters even more because some components interact directly with Windows.

That's why I increasingly prefer asking:

What assumptions does this feature make about the machine?

rather than:

Does it work on my laptop?

πŸ” 9. Testing Security Boundaries

Another area I'm becoming more interested in is security boundaries.

For every feature, I want to identify:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ATLOCK CONTROL β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ What ATLOCK controls β”‚
β”‚ β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ OS BOUNDARY β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ What Windows controls β”‚
β”‚ β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ HARDWARE BOUNDARY β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ What hardware controls β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

This prevents a dangerous engineering mistake:

assuming the application controls something that it actually doesn't.

🧠 10. Security Claims Need Boundaries

I don't want ATLOCK to become another project that says:

β€œMilitary-grade security.”

without explaining what that actually means.

I'd rather describe the system precisely.

For example:

NTFS ACL-based protection

is much more meaningful than:

β€œMilitary-grade file security.”

Likewise:

Fernet + PBKDF2-HMAC-SHA256

is a technical implementation detail.

It doesn't mean:

β€œNobody can ever access your data.”

Good security communication should explain capabilities and limitations.

πŸ§ͺ 11. My New Testing Loop

My testing mindset now looks more like:

            BUILD
              β”‚
              β–Ό
            TEST
              β”‚
              β–Ό
         BREAK IT
              β”‚
              β–Ό
      Find the assumption
              β”‚
              β–Ό
         Fix the design
              β”‚
              β–Ό
           TEST AGAIN
              β”‚
              └─────────────┐
                            β–Ό
                          BUILD
Enter fullscreen mode Exit fullscreen mode

The β€œbreak it” step is the most interesting one.

Because that's where you discover things you didn't know you had assumed.

πŸ’₯ 12. The Bug Is Often More Valuable Than the Feature

This sounds counterintuitive.

But sometimes a bug teaches me more than successfully implementing an entire feature.

A feature tells you:

β€œThis works.”

A bug asks:

β€œWhy did you think this would work?”

That second question is much more valuable.

Because it forces you to inspect:

assumptions
state transitions
dependencies
boundaries
error handling
architecture

And that knowledge carries over into the next feature.

πŸ”’ What ATLOCK Is Becoming

ATLOCK started as a Windows security application.

But while building it, it has also become something else:

a practical security engineering laboratory.

Every module exposes a different class of problem.

File Guard
↓
Windows authorization

Password Vault
↓
Cryptography + authentication

Intruder Ops
↓
Hardware + event handling

Desktop Lockdown
↓
Application/system interaction

Local-first architecture
↓
Privacy + data minimization

And connecting all of those pieces into one application creates problems that a tutorial rarely prepares you for.

🚧 What's Next?

There are still plenty of areas I want to improve:

More extensive Windows compatibility testing
Better failure-state recovery
More rigorous threat modeling
More defensive validation
Better permission-state handling
More robust camera failure handling
Cleaner internal module boundaries
Better automated testing
More transparent security-state feedback

ATLOCK v4 isn't the final answer.

It's another iteration.

Final Thought

I've stopped measuring a security feature only by whether it works.

Now I ask:

What happens when it doesn't?

Because that's where the real engineering begins.

A security system isn't defined only by its strongest path.

It's also defined by how gracefully it handles:

failure, uncertainty, unexpected input, unavailable hardware, permission problems, and assumptions that turned out to be wrong.

That's what I'm trying to build with ATLOCK.

Not software that looks secure.

Software whose security decisions I can actually explain.

πŸ”’ ATLOCK v4 β€” Akhouri Systems

πŸ‘‰ Try it / inspect the project:
https://github.com/Akhouri-Anmol-Kumar/ATLOCK

If you use Windows, I'd genuinely appreciate technical feedback.

Don't just tell me what works.

Tell me what breaks.

ATLOCK

"We Build What Others Forgot To Fix"

Top comments (0)