Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@happy-gastro/file-hash-vault
Advanced tools
Instead of storing the content as a file using the given filename, store the content using the hash of that content.
A class (called “FS”) in TypeScript, that takes a directory as an argument which will act as an interface to a file system.
We need two methods in this class:
store(filename, content):
Stores the content in filename within the given directory
get(filename)
: Returns the content from the filename
However, people are writing the same data over & over, but using different file names. So instead of storing the content as a file using the given filename, store the content using the hash of that content.
Let’s assume md5 is a "perfect" hashing function md5("content") -> "abcdef123456"
filename
- only alphabetical characters
Example usage:
fs = FS("/topdir")
fs.store("filename1", "a very long string1")
fs.store("filename2", "a very long string1")
fs.store("filename3", "a very long string3")
result1 = fs.get("filename1")// gets 'a very long string1'
result2 = fs.get("filename2")// gets 'a very long string1'
result3 = fs.get("filename3")// gets 'a very long string3'
In the previous example the “a very long string1"
is stored only once because two different files have the same content.
Write a short description of how would you deploy your solution in a cloud environment (AWS, Azure, GCP). What type of resources would you use and why?
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is developed and maintained by Farkas Ferenc.
Happy Gastro Ltd.
FAQs
Instead of storing the content as a file using the given filename, store the content using the hash of that content.
The npm package @happy-gastro/file-hash-vault receives a total of 0 weekly downloads. As such, @happy-gastro/file-hash-vault popularity was classified as not popular.
We found that @happy-gastro/file-hash-vault demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.