This project simulates a simple ATM system built in C++ featuring:
- Two user types: Account Holders & Admin
- Basic PIN-based authentication with XOR encryption
- Object-Oriented Design: Classes, inheritance, encapsulation
- Log in with PIN
- View account details
- Withdraw & Deposit money
- Secure login
- View admin credentials
- Reset any user's balance
-
PIN Encryption:
encryptDecrypt()uses XOR with a key for basic PIN protection. -
AccountHolder Class:
Stores account number, name, balance, encrypted PIN.
Methods:verifyPin()β Check PIN (after decryption)withdraw()β Deducts balancedeposit()β Adds to balanceshowDetails()β Displays account info
-
Admin Class:
Inherits from AccountHolder.
Methods:showDetails()β Displays admin inforesetBalance()β Modify user balance
-
ATM Class:
Handles user interaction & operations.
Methods:accessAccount()β Login, view, withdraw, depositfindAccount()β Search by name/account number
- OOP Principles: Classes, inheritance, encapsulation
- Simple Authentication: PIN-based, encrypted storage
- Admin Controls: User management & balance resets
- Interactive Input Loop: Multiple operations per session
User Login:
- Enter account number or name (e.g.,
John Doe) - Enter PIN (e.g.,
1234) - View balance, withdraw, deposit
Admin Login:
- Enter admin PIN (
admin) - Reset any user's balance
| Issue | Description & Suggestions |
|---|---|
| π Weak PIN Encryption | XOR w/ single key is insecure. Use modern hashing (SHA-256) |
| πΎ No Data Persistence | Data lost on exit. Use files or DB for real storage |
| π« Limited Error Handling | Add input validation (e.g., negatives, non-numeric input) |
| π‘οΈ Admin Inheritance | Admin inherits AccountHolder, but may not need balance |
| π§Ή Input Stream Handling | Careful use of cin.ignore() to avoid input glitches |
g++ atm_simulation.cpp -o atm_simulation
./atm_simulationA well-structured demonstration of OOP in C++ with user/admin roles, basic encryption, and ATM functionalities.
For real-world use:
- Improve security
- Add persistent storage
- Enhance input validation