A simple calculator implementation in Solidity that performs basic arithmetic operations on the blockchain.
- Addition
- Subtraction
- Multiplication
- Division
- Remainder
- Exponentiation
The contract can be deployed using Remix IDE (https://remix.ethereum.org/)
GPL-3.0
Custom password hashing and salting concepts using JavaScript.
- User registration (Sign Up)
- User authentication (Login)
- Password hashing with salt
- In-memory user storage
- Simple command-line interface
- Open your web browser
- Open the browser's developer tools (Usually F12 or right-click -> Inspect)
- Go to the Console tab
- Copy and paste the entire code into the console
- Press Enter to run
- Enter
1
for Sign Up - Enter
2
for Login - Enter
3
to Exit
- Select option 1
- Enter desired username
- Enter password
- System will confirm successful registration
- Select option 2
- Enter username
- Enter password
- System will verify credentials and provide feedback
-
Password Hashing:
- Converts passwords into hash values
- Original passwords are never stored
-
Salt Generation:
- Unique random salt for each user
- Prevents rainbow table attacks
- Makes identical passwords have different hashes
-
Credential Storage:
- Stores only hashed passwords with salt
- Username uniqueness enforcement
generateSalt()
: Creates random salt stringgenerateHash()
: Produces hash from password and saltsignUp()
: Handles user registrationlogin()
: Manages authenticationmain()
: Controls program flow