Google Authenticator
Google Authenticator — приложение для двухэтапной аутентификации с помощью Time-based One-time Password Algorithm (TOTP) и HMAC-based One-time Password Algorithm (HOTP) от Google LLC. Сервис реализует алгоритмы, указанные в RFC 6238 и RFC 4226.[2]
Google Authenticator | |
---|---|
![]() | |
![]() | |
Тип | аутентификатор[d] |
Разработчик | Google LLC |
Операционная система | Android, iOS, BlackBerry OS |
Первый выпуск | 20 сентября 2010[1] |
Аппаратная платформа | Мобильная |
Последняя версия | 5.10 (12 мая 2020) |
Лицензия | Проприетарная (прошлые версии выпускались под Apache License 2.0) |
Сайт | play.google.com/store/ap… |
Authenticator представляет 6- или 8-значный одноразовый цифровой пароль, который пользователь должен предоставить в дополнение к имени пользователя и пароля, чтобы войти в службы Google или других сервисов. Authenticator также может генерировать коды для сторонних приложений, такие как менеджеры паролей или услуг хостинга файлов. Предыдущие версии программы были доступны с открытым исходным кодом на GitHub, но последние выпуски являются частной собственностью Google.[3]
Пример использования
Как правило, пользователи должны сначала установить приложение на своё мобильное устройство. Для того, чтобы войти на сайт или воспользоваться услугами сервиса, требуется ввести имя пользователя и пароль, запустить приложение Authenticator и ввести в специальное поле сгенерированный одноразовый пароль.
Для этого сайт предоставляет общий секретный ключ пользователю, который должен быть сохранен в приложение Google Authenticator. Этот секретный ключ будет использоваться для всех будущих входов на сайт.
С двухэтапной аутентификацией простое знание логина/пароля не является достаточным для взлома учётной записи. Злоумышленник также должен знать секретный ключ или иметь физический доступ к устройству с Google Authenticator. Альтернативным путем является MITM-атака: если компьютер пользователя заражен трояном, то имя пользователя, пароль и одноразовый код могут быть перехвачены, чтобы затем инициировать свой собственный сеанс входа на сайте или отслеживать и изменять информацию между пользователем и сайтом.
Реализации
Google Authenticator представлен на Android,[4] BlackBerry, и 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 от:
- количества 30-секундных интервалов с начала «эры UNIX» для варианта TOTP
- счётчика, который увеличивается с каждым новым кодом для варианта HOTP.
Затем часть HMAC извлекается и преобразуется в 6-значный код.
Псевдокод для Time-based OTP
function GoogleAuthenticatorCode(string secret) // based on RFC 4226
key := base32decode(secret) // key: array of uint8
message := htobe64(current Unix time / 30) // message: uint64, make it big-endian
hash := HMAC-SHA1(key, message) // hash: array of uint8
offset := last nibble of hash // offset := hash[hash.size() - 1] & 0x0F
truncatedHash := (hash[offset] << 24) | (hash[offset+1] << 16) // truncatedHash: uint32 big-endian
| (hash[offset+2] << 8) | (hash[offset+3]
truncatedHash = truncatedHash & 0x7FFFFFFF // reset MSB
code := truncatedHash mod 1000000
pad code with 0 until length of code is 6
return code // code: string
Псевдокод для 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
Перенос аккаунтов

Пользователи могут выбрать, какие учетные записи экспортировать, а затем, после проверки с помощью ввода ПИН-кода устройства или биометрической аутентификации, отобразить QR-код, который может быть отсканирован другим телефоном с помощью Authenticator в режиме импорта.
Примечания
- 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 April 2013).
- Virtual TokenFactor (недоступная ссылка) (26 February 2012). Дата обращения: 27 июля 2016. Архивировано 8 сентября 2013 года.
- [APPGoogle Authenticator for Windows Mobile] . XDA Developers.
- http://blog dot jamesdotcuff dot net (недоступная ссылка). Дата обращения: 27 июля 2016. Архивировано 1 августа 2014 года.
- 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 (недоступная ссылка). Дата обращения: 27 июля 2016. Архивировано 15 октября 2017 года.
- 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 (недоступная ссылка). Дата обращения: 27 июля 2016. Архивировано 12 июля 2014 года.
- 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.
- RFC 4226 — HOTP: An HMAC-Based One-Time Password Algorithm
Ссылки
- Google Authenticator on Google Help
- Google Authenticator legacy source code on GitHub
- Google Authenticator implementation in Python on Stack Overflow