Google Authenticator

Материал из Википедии — свободной энциклопедии
Это старая версия этой страницы, сохранённая Syachin.d (обсуждение | вклад) в 09:00, 27 июля 2016 (Перевел страницу). Она может серьёзно отличаться от текущей версии.
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)
Перейти к навигации Перейти к поиску
Google Authenticator
Логотип программы Google Authenticator
Скриншот программы Google Authenticator
Screenshot of the Google Authenticator software package running on the Android mobile operating system
Тип аутентификатор[вд]
Разработчик Google
Операционные системы Android, iOS, BlackBerry OS
Первый выпуск 20 сентября 2010; 14 лет назад (2010-09-20)[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

Примечания

  1. Google Is Making Your Account Vastly More Secure With Two-Step Authentication - TechCrunch. TechCrunch (20 сентября 2010). Дата обращения: 12 марта 2016.
  2. 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
  3. Willis, Nathan (22 January 2014)."FreeOTP multi-factor authentication". LWN.net. Retrieved 10 August 2015.
  4. https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2 A
  5. Google Authenticator. App Store.
  6. Authenticator (4 апреля 2013).
  7. Virtual TokenFactor (26 февраля 2012).
  8. [APP]Google Authenticator for Windows Mobile. XDA Developers.
  9. http://blog dot jamesdotcuff dot net.
  10. mclamp/JAuth. GitHub.
  11. kamenitxan/FXAuth. GitHub.
  12. gauthj2me - Google Authentification in Java Mobile, j2me - Google Project Hosting.
  13. lwuitgauthj2me - Google Authenticator for J2ME phones - Google Project Hosting.
  14. chunlinyao / mobile-otp — Bitbucket.
  15. totp-me - TOTP for Java ME - Google authenticator.
  16. gauth.prc - gauthj2me - Google Authenticator for Palm OS (converted from java) - Google Authentification in Java Mobile, j2me - Google Project Hosting.
  17. tadeck/onetimepass. GitHub.
  18. chregu/GoogleAuthenticator.php. GitHub.
  19. rotp - RubyGems.org - your community gem host.
  20. ukazap/twofu. GitHub.
  21. heapsource/active_model_otp. GitHub.
  22. GAuth.
  23. gauth4win - Google Authenticator for windows - Google Project Hosting.
  24. MOS Authenticator Home.
  25. winauth - Windows Authenticator for Battle.net / World of Warcraft / Guild Wars 2 / Glyph / WildStar / Google / Bitcoin - Google Project Hosting.
  26. glacasa/TwoStepsAuthenticator. GitHub.
  27. gbraad/html5-google-authenticator. GitHub.
  28. Techtransit. Nokia Store: Download GAuth and many other games, wallpaper, ringtones and mobile apps on your Nokia phone.
  29. SGAuth.
  30. SailOTP.
  31. google-authenticator-apache-module - Apache Module for Two-Factor Authentication via Google Authenticator - Google Project Hosting.
  32. google-authenticator - Two-step verification - Google Project Hosting.
  33. oauth-pam - PAM for use with OAuth Websites - Google Project Hosting.
  34. Authenticator.
  35. OTP Auth. App Store.
  36. https://tools.ietf.org/html/c#section-4

Ссылки

Шаблон:Google Inc.