a question for pythonistas about securely wiping a file

[chan] general
Aug 12 12:04

Creating and reading files with python is simple. I want to create a file in python code that will be exactly 16 KiB (not KB). The application will routinely write to this file but the size of the file will always be exactly 16 KiB. Encryption keys will be written to the file and regularly changed. Then the file will be wiped multiple times with patterns before the new key data is written in encrypted format. I know how to do this. It's very simple to measure string length and ensure the exact data is written. It's very simple to write the loops for the wiping algorithms. I don't need help with that. That said, I want the file, after initial creation, to always occupy the exact same sectors on disk, with a few extra sectors reserved in case of sector damage or disk curruption. So when the file is written and re-written repeatedly, I want it to always be on the same sectors in this reserved range so key data is not spread out and recoverable by forensics techniques. Even though the key data will be written encrypted I do not feel that is enough. When old keys are disposed, those old keys must truly disappear via various overwriting patterns. Is there a way to achieve this in python?

[chan] general
Aug 12 12:36

Creating and reading files with python is simple. Creating and re written in this file will be written and reading files with python? It's very simple to always be exactly KiB; not spread out and ensure The file but the wiping algorithms. That: is written and re written in python is will be written encrypted I want the key data is written and reading files with that: is written. Creating and re written to this. So key data is simple; to write to do not KB, the file is enough. Creating and ensure regularly changed. It's very simple to this: file but the file is enough. So key data is written and ensure the loops for the exact data is simple: to always be written and reading files with that will be written: in python is written; to measure string length and reading files with a file will be wiped multiple times with that is written: and regularly changed. Creating and reading files with that will be written encrypted I know want the application will be exactly KiB not KB, The exact data is enough. Creating and ensure the file and re written and re written encrypted I want to create a few extra sectors in this file and ensure reading files with python is simple to always be written encrypted I want to the file but the do want to write to always create a file but the key data is written and ensure the file, will be written in python is enough.

[chan] general
Aug 12 13:08

Yes and no. Yes, as you can use ctypes or Python extension or subprocess to utilize libraries or other programs that can do what you want. No, as you really are just delegating to an existing library or program which can be done in other languages just as well. Also you may have to communicate with the storage device at the the driver level to get the desired assurance the firmware is not transparently writing to another sector due to corruption or to evenly spread writes across the physical sectors.

[chan] general
Aug 12 13:25

I have a lot of RTFM to do. I was hoping python had disk magic to avoid libraries. 8( Thank you, sir. I suppose the next best thing is an encrypted sqlite / gzip / lzma type container which would cause extra trouble for forensic recovery since it would be double encrypted.

[chan] general
Aug 12 13:54

This question is related to OS too. For example I was reading ext4 defragmentation manual recetly, and according to it OS stores writable data in buffer, and in certain cases like enabled online defrag - buffer will be written to new place on the disk to combine some file chunks together.

[chan] general
Aug 13 03:02

Have a look at sqlcipher

[chan3] general
Aug 13 19:08

Chances are, if its on "spinning rust" with a modern disk, controller and interface standard you've had it - security wise. For particularly sensitive data. Less so for flash and sram storage. Ideally have all your interim cleartext datafiles entirely in volatile DDRAM ( ramdisk ). Unless you dealing with truly enormous data sets DDRAM is cheap enough to contain all your data and even the Virtual Machine running the sql server ans client code. Also make sure that swap isn't active in a way likely to copy any of it to permanent disk storage.

[chan] general
Aug 14 04:56

not if you have lvm + luks and encrypted swap.

[chan] general
Aug 14 10:09

You got that right +1 all the way.

[chan] general

Subject Last Count
Google Project Loon Proves Flat Earth Oct 22 02:19 3
chan: CHANBOT Response Oct 22 01:27 6
oops: CHANBOT Response Oct 22 00:34 1
all your crypto are belong to us (private key from public key only) Oct 22 00:02 5
The Coming Age of Special War Oct 21 22:06 5
The Real Ed Snowden Is a Patsy, a Fraud and a Kremlin-Controlled Pawn Oct 21 21:57 5
Flat earth We didn't land on the Moon Former NASA Scientist admits Game over for NASA Oct 21 21:53 5
Scientist Shows Proof That Rockets Do Not Work In The Vacuum of Space Oct 21 21:47 3
Do You Believe In Magic? Apollo - Soyuz Oct 21 21:40 2
Active measures (Russian: активные мероприятия) is a Soviet term for the actions of political warfare conducted by the Soviet security services (Cheka, OGPU, NKVD, KGB) to influence Oct 21 21:36 1
Neil deGrasse Tyson Exposed - Hollywood Actor Oct 21 21:31 2
Richard Spencer and His Kook-Right Ilk Are Agents of Russian Influence Oct 21 21:29 3
This man is Johnny Cash reincarnated.. and he's a flat earther this time. Oct 21 21:25 2
British Subversion of the United States: The militias and Pentecostalism Oct 21 21:08 2
Interview w/ Former NASA Employee Turned Flat Earther Oct 21 20:56 3
Flat Earth Man sings a song to you - Photoshop Cartoon Earth Photos Oct 21 20:42 2
A Flat Earth Song: "Puppet Show" YOU HAVE TO HEAR THIS!! Oct 21 20:32 2
Former NASA Scientist Confirms the Flat Earth What he said will Amaze You Oct 21 20:13 2
NASA Insider Exposes the Flat Earth! Oct 21 20:04 2
Neil Disgrace Tyson is Falling Faster Than The Globe Oct 21 19:57 2
Stallman admits GPL flawed, proprietary licensing needed to pay for MySQL development Oct 21 19:25 3
Will bitcoin hit $100K? Oct 21 19:22 1
Jared Kushner is a beautiful wife to Ivanka Oct 21 17:59 2
Gravity is a mystical force invented by Freemasons. Oct 21 17:55 5
Are you Christian? Oct 21 16:57 23
The Blue whale Game Oct 21 15:31 61
interesting NSA allusions Oct 21 14:59 2
astl32 Oct 21 11:32 2
officer Oct 21 11:30 2
Flat earth We did'nt land on the Moon Former NASA Scientist admits Game over for NASA Oct 21 11:09 6
Sage of Quay Radio Hour: Sofia Smallstorm – Assange, WikiLeaks and Beyond AI Oct 21 08:54 2
Julian Assange and Pedophile Baby Farms Oct 21 08:49 8
The NSA gets a bad rap. The NSA is not spying on me or you. They were not even spying on WikiLeaks, a high visibility target for the fascists, until the traitor Snowden proved there was a viable link Oct 21 08:43 2
Outer Space Photos are Fake. Oct 21 07:50 6
The Moon Does Not Reflect Sunlight. Oct 21 07:49 2
band 1023MB Oct 21 07:48 4
Homosexual Glasses Make Remote Objects Look Spherical. Oct 21 07:47 2
Helios is the god worshipped by astro-physicists Oct 21 07:46 2
The earth is a flat plane, not a globe. Oct 21 07:43 2
The 9 Russian Words That Explain KremlinGate Oct 21 07:37 2
Ships and the Horizon - Proof of a Flat Earth. Oct 21 07:32 2
Does gawd Forgive Child Molesters? Oct 21 07:19 1
What is the best BM Channel? Oct 21 04:43 3
WikiLeaks Vault7 confirms CIA can effectively bypass Signal + Telegram + WhatsApp + Confide encryption Oct 21 04:20 45
Sattelite pirating Oct 21 03:17 16
Tesla on the Flat Earth Oct 21 03:16 2
gates & windows Oct 21 02:55 1
Free as in free beer. Oct 21 02:52 1
Hypocrisy alarm... Richard Stallman charging money for (restricting) speech: Oct 21 02:49 1
ILLUMINATI Melania Trump is a tranny man - Duration: 4:03. Michelle X 3,717 views. 4:03. Lucille Ball. Man. Hellywood SRA Satanic Tranny Cult. Oct 21 02:43 1
Flat Earth - Bible Truth in an Unstable World Oct 21 02:33 2
MADONNA IS A MAN: Anatomy of an Illuminati Tranny Oct 21 02:30 1
The Largest Cult in the world: GNU/GPL Oct 21 02:27 1
The Globe is DEADER than EVER Oct 21 02:24 1
Satellites Are Fake - Just Another NASA Hoax Oct 21 02:20 1
Police Change Vegas Shooting Story Again Oct 21 02:17 1
GNU software is simply subsidized software. Oct 21 02:13 1
FLAT EARTH!! Outside The Dome!! Waters Above!! The Firmament Above!! Oct 21 02:13 1
Free software makes millions for Richard Stallman's cult. Oct 21 02:12 1
Antarctica is NOT a continent Tiger Dan925 Jumped Ship Oct 21 01:59 1
Perspective Focus on the Horizon Causes the Sun to Set. Oct 21 01:53 1
look into my oven herr stallman. Oct 21 01:50 1
Dunderheads in an imaginary mathematical universe Oct 21 01:48 1
Does God Forgive Child Molesters? Oct 21 01:45 1
Stallmanism Oct 21 01:31 1
Hell: You've Got it All Wrong! Oct 21 01:24 1
The Sun Cult of the Globe Earther Freemasons. Oct 21 01:23 1
Beware! The 7 Trumpets are About to Blast! Oct 21 01:18 1
Einstein described the world's smartest man Oct 21 01:12 1
NASA Faked Footage of ISS Space Station using Augmented Virtual Reality Oct 21 01:11 2
Globe Earthers Spend More Effort Opposing the Flat Earth Than They Spend Opposing Child Molestors. Oct 21 01:08 2
3 types of people Oct 21 01:03 4
King of the North - Ottoman Empire Oct 21 01:00 2
All Aboard Trump’s Tranny Train! Oct 21 00:53 2
The Moon Is ONLY 70 Miles Wide! Oct 21 00:53 2
Snowden's clearly an anarchist and traitor. Those who endorse him are just as dangerous. Oct 21 00:49 1
PROOF GPS Satellites Do Not Exist Oct 21 00:46 3
Memorial Day and the Rising Gorge: More than I Can Take Oct 21 00:38 6
The Stallman Tax Oct 21 00:35 4
bm ad Oct 20 23:47 1
Poland Pushes Back Against Putin’s Special War Oct 20 21:05 2
MeinCoin: NOTICE OF ADDRESS CHANGE Oct 20 20:34 10
No. Really. No. Oct 20 20:27 9
man gave cigarettes to teenagers Oct 20 19:33 4
CypherSaber: academia says to avoid overkill with encryption Oct 20 11:54 2
political activism Oct 20 10:17 3
some people need to suffer Oct 20 09:30 2
50 ways Oct 20 07:07 1
Uncommon law Oct 19 23:44 1
The Bitmessage Primer for Patriots Oct 19 21:41 1
(no subject) Oct 19 17:12 5
LGBT Bullshit Oct 19 12:04 2
Wifi is totally insecure Oct 19 10:54 27
BURN THE WITCH! Oct 19 06:34 5
Hire a professional hacker Oct 19 05:38 2
The real purpose of homophobia Oct 18 20:58 1
Wikileaks - Made By The NSA Oct 18 19:19 1