Google Authenticator
Google Authenticator | |
---|---|
![]() | |
Скриншот программы Google Authenticator Screenshot of the Google Authenticator software package running on the Android mobile operating system | |
Тип | аутентификатор[вд] |
Разработчик | |
Операционные системы | Android, iOS, BlackBerry OS |
Первый выпуск | 20 сентября 2010[1] |
Аппаратная платформа | Mobile |
Лицензия | Proprietary (earlier versions were under Apache License 2.0) |
![]() |
Google Authenticator приложение для двух этапной аутентификации с помощью Time-based One-time Password Algorithm (TOTP) и HMAC-based One-time Password Algorithm (HOTP) от Google. Сервис реализует алгоритмы указанные в RFC 6238 и RFC 4226.[2]
Authenticator представляет 6 или 8 значный одноразовый цифровой пароль, который пользователь должен предоставить в дополнение к имени пользователя и пароля, чтобы войти в службы Google или других сервисов. Authenticator также может генерировать коды для сторонних приложений, такие как менеджеры паролей или услуг хостинга файлов. Предыдущие версии программы были доступны с открытым исходным кодом на GitHub, но последние выпуски являются частной собственностью Google.[3]
Пример использования
Как правило, пользователи должны сначала установить приложение на свой смартфон. Для того, чтобы войти на сайт или воспользоваться услугами сервиса, требуется ввести имя пользователя и пароль, запустить приложение Authenticator и ввести в специальное полу сгенерированный 6-8 значный одноразовый пароль.
Для этого, сайт предоставляет общий секретный ключ пользователю, который должен быть сохранен в приложение Google Authenticator. Этот секретный ключ будет использоваться для всех будущих входов на сайт.
С двух этапной аутентификацией, простое знание логина/пароля не являеться достаточным для взлома учетной записи. Злоумышленник также должен знать секретный ключ или иметь физический доступ к устройству с Google Authenticator. Альтернативным путем является MITM атака: если компьютер пользователя заражен трояном, то имя пользователя, пароль и одноразовый код могут быть перехвачены, чтобы затем инициировать свой собственный сеанс входа на сайте или отслеживать и изменять информацию между пользователем и сайтом.
Реализации
Google Authenticator предоставлен на Android,[4] BlackBerry, and iOS[5]. Также доступно несколько сторонних реализаций:
- Windows Phone 7.5/8/8.1/10: Microsoft Authenticator[6] Virtual TokenFactor[7]
- Windows Mobile: Google Authenticator for Windows Mobile[8]
- Java CLI: Authenticator.jar[9]
- Java GUI: JAuth[10] FXAuth[11]
- J2ME: gauthj2me[12] lwuitgauthj2me[13] Mobile-OTP (Chinese only)[14] totp-me[15]
- Palm OS: gauthj2me[16]
- Python: onetimepass[17]
- PHP: GoogleAuthenticator.php[18]
- Ruby: rotp,[19] twofu[20]
- Rails: active_model_otp[21] (third party implementation)
- webOS: GAuth[22]
- Windows: gauth4win[23] MOS Authenticator[24] WinAuth[25]
- .NET: TwoStepsAuthenticator[26]
- HTML5: html5-google-authenticator[27]
- MeeGo/Harmattan (Nokia N9): GAuth[28]
- Sailfish OS: SGAuth,[29] SailOTP[30]
- Apache: Google Authenticator Apache Module[31]
- PAM: Google Pluggable Authentication Module[32] oauth-pam[33]
- Backend: LinOTP (Management Backend implemented in python)
- Chrome/Chrome OS: Authenticator[34]
- iOS: OTP Auth[35]
Техническое описание
Поставщик услуг генерирует 80-битный секретный ключ для каждого пользователя (хотя RFC 4226 §4 требует минимум 128 бит и рекомендует 160 бит).[36] Это обеспечивается как 16, 26, 32 значный код в кодировке Base32 или с помощью QR кода. Клиент создает HMAC-SHA1 используя этот секретный ключ. Сообщение HMAC может быть:
- числовым с 30 секндным периодом (TOTP)
- счётчиком, который увеличивается с каждым новым кодом (HOTP).
Затем часть HMAC извлекается и преобразуется в 6 значный код.
Псевдокод для One Time Password OTP
function GoogleAuthenticatorCode(string secret)
key := base32decode(secret)
message := floor(current Unix time / 30)
hash := HMAC-SHA1(key, message)
offset := last nibble of hash
truncatedHash := hash[offset..offset+3] //4 bytes starting at the offset
Set the first bit of truncatedHash to zero //remove the most significant bit
code := truncatedHash mod 1000000
pad code with 0 until length of code is 6
return code
Псевдокод для Event/Counter OTP
function GoogleAuthenticatorCode(string secret)
key := base32decode(secret)
message := counter encoded on 8 bytes
hash := HMAC-SHA1(key, message)
offset := last nibble of hash
truncatedHash := hash[offset..offset+3] //4 bytes starting at the offset
Set the first bit of truncatedHash to zero //remove the most significant bit
code := truncatedHash mod 1000000
pad code with 0 until length of code is 6
return code
Примечания
- ↑ Google Is Making Your Account Vastly More Secure With Two-Step Authentication - TechCrunch . TechCrunch (20 сентября 2010). Дата обращения: 12 марта 2016.
- ↑ GitHub - google/google-authenticator: Open source version of Google Authenticator (except the Android app) (англ.). GitHub. Google. — «These implementations support the HMAC-Based One-time Password (HOTP) algorithm specified in RFC 4226 and the Time-based One-time Password (TOTP) algorithm specified in RFC 6238.»
- ↑ Willis, Nathan (22 January 2014)."FreeOTP multi-factor authentication". LWN.net. Retrieved 10 August 2015.
- ↑ https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2 A
- ↑ Google Authenticator . App Store.
- ↑ Authenticator (4 апреля 2013).
- ↑ Virtual TokenFactor (26 февраля 2012).
- ↑ [APP]Google Authenticator for Windows Mobile . XDA Developers.
- ↑ http://blog dot jamesdotcuff dot net .
- ↑ mclamp/JAuth . GitHub.
- ↑ kamenitxan/FXAuth . GitHub.
- ↑ gauthj2me - Google Authentification in Java Mobile, j2me - Google Project Hosting .
- ↑ lwuitgauthj2me - Google Authenticator for J2ME phones - Google Project Hosting .
- ↑ chunlinyao / mobile-otp — Bitbucket .
- ↑ totp-me - TOTP for Java ME - Google authenticator .
- ↑ gauth.prc - gauthj2me - Google Authenticator for Palm OS (converted from java) - Google Authentification in Java Mobile, j2me - Google Project Hosting .
- ↑ tadeck/onetimepass . GitHub.
- ↑ chregu/GoogleAuthenticator.php . GitHub.
- ↑ rotp - RubyGems.org - your community gem host .
- ↑ ukazap/twofu . GitHub.
- ↑ heapsource/active_model_otp . GitHub.
- ↑ GAuth .
- ↑ gauth4win - Google Authenticator for windows - Google Project Hosting .
- ↑ MOS Authenticator Home .
- ↑ winauth - Windows Authenticator for Battle.net / World of Warcraft / Guild Wars 2 / Glyph / WildStar / Google / Bitcoin - Google Project Hosting .
- ↑ glacasa/TwoStepsAuthenticator . GitHub.
- ↑ gbraad/html5-google-authenticator . GitHub.
- ↑ Techtransit. Nokia Store: Download GAuth and many other games, wallpaper, ringtones and mobile apps on your Nokia phone .
- ↑ SGAuth .
- ↑ SailOTP .
- ↑ google-authenticator-apache-module - Apache Module for Two-Factor Authentication via Google Authenticator - Google Project Hosting .
- ↑ google-authenticator - Two-step verification - Google Project Hosting .
- ↑ oauth-pam - PAM for use with OAuth Websites - Google Project Hosting .
- ↑ Authenticator .
- ↑ OTP Auth . App Store.
- ↑ https://tools.ietf.org/html/c#section-4
Ссылки
- Google Authenticator on Google Help
- Google Authenticator legacy source code on GitHub
- Google Authenticator implementation in Python on Stack Overflow
- Authenticator в F-Droid