Background: The security of a system or a network relies on how its users are validated to gain access over them. Usually these users are validated using passwords. One time password is a dynamic password which is valid for only one logged in session. OTP is being widely used nowadays in applications that involve e- transactions. Methods: OTPs are a pseudo random sequence of alphanumeric characters that are generated using mathematical algorithms. We propose a simple and efficient method for generating one time passwords using HMAC function. Results: HMAC value used for generating OTP is irreversible. Thus H(m) and H(m’) cannot be correlated to a same value. Predictions of future OTP cannot be done as random sequence of hexadecimal digits are generated. Conclusion: One time password is a single time use password and thus cannot be reused or stolen for future use. Generation method for OTP involves simple and efficient mathematical function. © 2016, International Journal of Pharmacy and Technology. All rights reserved.