Author Archives: HazardEdit

Using USB Device as Key for Authentication System

Using a USB Device as Key for Authentication System
Good day, In this post I would like to present you an idea which came to my mind the other day. I was thinking of a cool and convenient way for an authentication system which does not require typing anything into an entry field. Getting to the point: I thought about using a USB device, USB storage / flash drive or mobile phone etc. as the key for an authentication system. This means whenever you have to authenticate in a system all you need to do is plugging in your USB device. The authentication system will scan it and determine whether it is white listed as a valid key for the authentication or not.

So I decided to go on researches on the internet to find out how I will be able to access the USB devices of my Windows 7 Computer and how I will be able to determine its current state, means knowing if it is plugged in at the current moment or not.
I found out I could use Marshal, which is a class located in the System.Runtime.InteropServices of .NET 4.0 Namespace to achieve this. A short bit later I was able to find a public class which would let me do exactly what I need. I decided not to reinvent wheels and use the public class I have found on CodeProject.

Here is a preview of what I have achieved at the end
Read more [...]

Implementing TOTP Google Authenticator with PHP

Today I decided to write an article on how to implement the TOTP Google Authenticator into your website’s login authentication system using PHP for any purpose (software, mobile app, website). It does not matter whether you want to use it for a website or software you have created or a mobile phone app, the Google Authenticator does not have to be necessarily used with PHP and either way you can use PHP for your authentication interface anywhere.

What is TOTP?
TOTP is a short form for Time-based One-time Password (usually called Token) which is password that can only be used once and is only valid to be used in a defined time range. Usually TOTP generators generate new passwords every defined number of seconds or minutes. Read more [...]