A console-based e-commerce management system written in C++ with a focus on security fundamentals: Role-Based Access Control (RBAC), a custom cipher for credentials at rest, Two-Factor Authentication, and audit logging.
- Credentials at rest — a shift-based cipher obfuscates usernames and passwords in the text-file database.
- Two-Factor Authentication — admin login requires an OTP from a simulated token system.
- Activity logging — sensitive actions (logins, product deletion, role
changes) are appended to
ActivityLogs.txtfor non-repudiation. - Input sanitation — custom validation to prevent buffer issues and type-mismatch errors during data entry.
- Admin — user management, 2FA toggle, audit logs, sales analysis.
- Employee — inventory management, restock alerts, support tickets.
- Customer — browse products, cart, wishlist, checkout.
- Language: C++ (standard library only)
- Storage: flat text files, written at runtime
- Interface: colour-coded console menus
| File | Role |
|---|---|
main.cpp |
entry point and authentication |
admin.h / employee.h / customer.h |
role-specific logic |
basicfunctionalities.h |
string utilities and security checks |
The *.txt files (product catalogue, carts, logs, OTPs, credentials) are the
runtime database — they are generated by the program on first run and are
git-ignored, so a clean checkout starts empty.
git clone https://github.com/saimcyber/Secure-Shop-cpp.git
cd Secure-Shop-cpp
g++ main.cpp -o secureshop
./secureshopThis is a learning project. The cipher is a teaching device, not real cryptography — do not store real credentials in it.
MIT — see LICENSE.