I want to create a secure script that grants access to files based on specific conditions. The access should be controlled by both time-based and API-based conditions. The script should only allow file access if:
- A specific query from an API returns true.
- The current time is within a predefined range.
Additionally, the script must ensure that users cannot access the files directly and can only do so through the script. Here are the key requirements:
- Time-Based Condition: Access should only be allowed during a specified time range.
- API-Based Condition: Access should only be granted if a certain condition from an API response is met.
- Security Measures: Users should not be able to bypass the script to access the files directly.
Questions:
- How should I design this script to ensure it checks both time-based and API-based conditions before granting access to files?
- What security measures should I implement to ensure that the files can only be accessed through this script and not directly by the user?
- How can I obfuscate this code to prevent users from modifying it and bypassing the system?
Environment:
- Operating System: Windows 11
cryptography
package in python and wrote some code which is not functional. I was getting the feeling that I should use Batch instead and it will be easier to implement. I want a conditional protocol where the piece of code will determine based on the current time and the API query if the file access to the user is granted or not to the user