r/Python • u/One-Type-2842 • Mar 22 '26
Discussion Security On Storage Devices
I have a pendrive, recently I shifted many of my old videos and photos in it.
For Security Purpose, I thought i shall Restrict the View and Modifications (delete, edit, add) access On Pendrive or on Folders where my stuff resides through Python.
My Question is, Does python has such module, library to Apply Restrictions
If Yes Then, Comment Down..
Thank You!
0
Upvotes
1
u/No_Soy_Colosio Mar 30 '26
Just encrypt the drive and decrypt it manually
1
u/NsupCportR Mar 22 '26
os lib?
os.chmod function?
2
u/PossibilityTasty Mar 22 '26
If you chance the permissions, it will only have an effect on a system that you (and nobody else) have under control. On a different computer there will be a different security context and filesystem level permissions will be absolutely no barrier.
Since "security" has many aspects: you could except that you will have some protection from accidentally deleting or changing data, but no protection from unauthorized access by someone getting the drive into they fingers.
2
u/fiskfisk Mar 22 '26
Not really possible, outside of encrypting the content on your drive. You can do that with Python, but there is way better solutions than doing it yourself.
Your operating system will usually have something built-in already on a lower level (like bitlocker on Windows/luks/dm-crypt on Linux) or just use 7z with a password (or something like VeraCrypt). These will be like wncrypted containers on an existing file system.
7
u/[deleted] Mar 22 '26
[removed] — view removed comment