
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Obscure filenames of mp4 files - away from being embarrassed by accidently opening family videos at work!
Obscure filenames of mp4 files - away from being embarrassed by accidently opening family videos at work!
Install with: pip install filenames_secure
Obscure filenames of mp4 files - away from being embarrassed by accidently opening family videos at work!
Simply $ filenames_secure
to obscure and restore.
Filenames will be CRC-32'd, with restore record kept in an JSON file in the same folder.
If there are hash collisions, a different secure filename will be selected, then the collision check goes again, until there are no collisions - so there should be no risks of getting data lost - however, there are no warranties.
If filename A is encoded into B this time, it will be encoded into B again next time, and forever - if there are no collisions that force a change.
No. It rarely happens. If it occurs, I suggest going out, buying a lottery.
The code is simple:
import os
import abbrs
def current_path():
p = os.path.realpath(__file__)
p = os.path.split(p)[0]
p = os.path.split(p)[-1]
return p
PACKAGE_NAME = current_path()
RC_FILENAME = f'{PACKAGE_NAME}.json'
def make_dat(ls):
def is_mp4(x):
s = x.split('.')
return len(s) >= 2 and (s[-1] == 'mp4' or s[-2] == 'mp4')
def check_collision(d):
for i, v in enumerate(d):
for j in range(i + 1, len(d)):
if d[i][0] == d[j][0]:
return j
dat = [ [ abbrs.cool_hash(i), i ] for i in filter(is_mp4, ls) ]
while True:
i = check_collision(dat)
if i:
print(f'Repairing collision: {dat[i][0]} -> {dat[i][1]}')
dat[i][0] = abbrs.cool_hash(dat[i][0])
else:
break
return dat
def restore():
dat = abbrs.load_json(RC_FILENAME)
for hash, filename in dat:
os.rename(hash, filename)
abbrs.suspend_file(RC_FILENAME)
def secure():
dat = make_dat(os.listdir())
if len(dat) == 0:
print('MP4 files not found.')
return
abbrs.json_dump(RC_FILENAME, dat)
print(abbrs.table([ 'Hash', 'Filename' ], dat))
for hash, filename in dat:
os.rename(filename, hash)
def main():
if os.path.exists(RC_FILENAME):
restore()
else:
secure()
if __name__ == '__main__':
main()
FAQs
Obscure filenames of mp4 files - away from being embarrassed by accidently opening family videos at work!
We found that filenames-secure demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.