SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
Image: Carlos Porto / FreeDigitalPhotos.net


                        TYPO3-Camp München - 11./12. September 2010       Inspiring people to
                        Passwörter sicher speichern mit saltedpasswords   share
Passwörter sicher speichern mit der
       Systemextension saltedpasswords


                   Steffen Gebert <steffen@steffen-gebert.de>




                 TYPO3-Camp München - 11./12. September 2010


                                                                Inspiring people to
Passwörter sicher speichern mit saltedpasswords             share
Einführung


Vorstellung


        Steffen Gebert
         Student, Freelancer

      TYPO3 Core Team Member




                                                  Inspiring people to
Passwörter sicher speichern mit saltedpasswords   share
Einführung


Upps..
     TYPO3 Assicciation, 3rd Quarterly Report 2008

         “What happened? An unauthorized person gained
         administrative access to the typo3.org website. As
         far as we can tell, an admin password was stolen
         and used to find out more passwords on typo3.org.”

     Speicherung sensibler Daten (z.B. Passwörter) bestmöglichst
     vermeiden!




                                                     Inspiring people to
Passwörter sicher speichern mit saltedpasswords      share
Einführung


Speicherung von Passwörtern
     Absolutes No-Go: Speicherung des Klartextpassworts

     Stattdessen

         Speicherung eines Hashes (“Prüfsumme”)

         Bei Login nur Vergleich mit dieser Prüfsumme




                                                        Inspiring people to
Passwörter sicher speichern mit saltedpasswords         share
Einführung


Grundlagen Hashing
     Einwegfunktion

         gleiche Eingabe => gleiches Ergebnis
         md5(‘joh316’) = ‘bacb98acf97e0b6112b1d1b650b84971’

         Rückrichtung algorithmisch nicht möglich

     Meistgenutzter Algorithmus: MD5

         gilt nicht mehr als sicher (Kollisionen relativ einfach, riesige
         Rainbowtables verfügbar)

         Alternativen (SHA) liefern nur größeren Ergebnisraum
         => Verschiebung des Problems auf neue Rainbowtables


                                                          Inspiring people to
Passwörter sicher speichern mit saltedpasswords           share
Einführung


Abspeichern eines salted Passworts
     Benutzereingabe: ‘joh316’

     Salt generieren, z.B. ‘7deb882cf’

     Berechnung des Hashes
     md5(‘7deb882cf’ . ‘joh316’) = ‘bacedc598493cb316044207d95f7ad54’

     Abspeichern von Salt und Hash




                                                  Inspiring people to
Passwörter sicher speichern mit saltedpasswords   share
Einführung


Überprüfen eines Passworts
     Benutzereingabe: ‘joh316’

     Genutztes Salt aus Datenbank auslesen: ‘7deb882cf’

     Berechnung des Hashes
     md5(‘7deb882cf’ . ‘joh316’) = ‘bacedc598493cb316044207d95f7ad54’

     Vergleich mit abgespeichertem Hash




                                                     Inspiring people to
Passwörter sicher speichern mit saltedpasswords      share
Die Extension


Systemextension saltedpasswords
      Ursprünglich t3sec_saltedpasswords von Marcus Krause

      Aufnahme in den Core in Version 4.3 mit Hilfe von Steffen Ritter




                                                        Inspiring people to
Passwörter sicher speichern mit saltedpasswords         share
Die Extension


Implementierte salting-Methoden
      Salted MD5

      Portable PHP password hashing framework

         Verfügbar für diverse PHP Applikationen (Drupal etc.)

         Wiederholte Anwendung von MD5 (langsam)

      Blowfish

         Verfügbarkeit systemabhängig

         Ab PHP 5.3 eigene Implementierung



                                                       Inspiring people to
Passwörter sicher speichern mit saltedpasswords        share
Die Extension


Der Knackpunkt
      Passwort muss im Klartext vorliegen

         TYPO3 übermittelt standardmäßig nur MD5-Hash

         Klartextübertragung jedoch unsicher

      Voraussetzung (mind. eine)

                SSL-Verbindung

                Systemextension rsaauth
                Verschlüsselt Passwörter vor Übertragung mit
                RSA-Algorithmus



                                                          Inspiring people to
Passwörter sicher speichern mit saltedpasswords          share
Installation & Konfiguration


rsaauth
      Voraussetzungen

         OpenSSL: PHP-Erweiterung empfohlen, Binary als Fallback

         JavaScript

      Aktivierung

         Frontend
         $TYPO3_CONF_VARS[FE][loginSecurityLevel] = ‘rsa’

         Backend
         $TYPO3_CONF_VARS[BE][loginSecurityLevel] = ‘rsa’;




                                                     Inspiring people to
Passwörter sicher speichern mit saltedpasswords      share
Installation & Konfiguration


saltedpasswords mit SSL-Verbindung
      Frontend

         $TYPO3_CONF_VARS[FE][loginSecurityLevel] = ‘normal’

      Backend

         $TYPO3_CONF_VARS[BE][lockSSL] > 0




                                                  Inspiring people to
Passwörter sicher speichern mit saltedpasswords   share
Installation & Konfiguration


Installation saltedpasswords
      Prüft Verfügbarkeit von rsaauth oder lockSSL




      Aktivierung für FE / BE getrennt

      Wahl des Hashing-Algorithmus

                                                     Inspiring people to
Passwörter sicher speichern mit saltedpasswords      share
Kompatibilität


Abwärtskompatibilität
      Existierende Passwörter? (unsalted MD5)

          können nicht sofort konvertiert werden, da nicht im
          Klartext abgespeichert

          einzig möglicher Zeitpunkt: während Login




                                                        Inspiring people to
Passwörter sicher speichern mit saltedpasswords        share
Kompatibilität


Extensions
      Frontend

          felogin kompatibel

          srfeuserregister_t3secsaltedpw

          Alternative FE-User Registrierungen?

      Ggf. Anpassungen nötig (Single-Signon etc.)




                                                    Inspiring people to
Passwörter sicher speichern mit saltedpasswords     share
Hintergrundwissen


Passwortformate
     MD5 ohne Salt (zur Erinnerung)
     bacb98acf97e0b6112b1d1b650b84971

     MD5 mit Salt
     beginnt mit $1$, 12 Zeichen Salt
     $1$13NETowd$WFpl6npZF71YKkCCzGds2.

     Blowfish
     beginnt mit $2a$, 22 Zeichen Salt
     $2a$07$DZpLLz7wtIfhSSMwyEXjA.Nbh6rpDlqbgwVKa.IoDLyuLe5C7Jp8W

     PHPASS
     beginnt mit $P$
     $P$Ccw7UIZ..SkvKBXDWnZlZ.qHcbktrB.



                                                  Inspiring people to
Passwörter sicher speichern mit saltedpasswords   share
Hintergrundwissen


Passwortformate Pro & Contra
     PHPASS

         niedrige Systemvoraussetzungen (zu jeder PHP-Version kompatibel)

         setzt PHPASS-Implementierung in Applikation voraus

     MD5 / Blowfish

         Unix crypt() Format, kompatibel zu Systemdiensten (/etc/passwd)

         vielleicht doch die bessere Wahl (?)

         Algorithmen von PHP/System abhängig

         mit PHP 5.3.2 auch SHA-256/512 möglich

                                                      Inspiring people to
Passwörter sicher speichern mit saltedpasswords       share
Hintergrundwissen


Nutzung von crypt() [3]
     Passwortüberprüfung:
     crypt($user_input, $encrypted_password) == $encrypted_password);

     Gespeicherter Hash (incl. Salt):
     $1$13NETowd$WFpl6npZF71YKkCCzGds2.

     crypt(joh316, $1$13NETowd$WFpl6npZF71YKkCCzGds2.)
           = $1$13NETowd$WFpl6npZF71YKkCCzGds2.

     crypt(password, $1$13NETowd$WFpl6npZF71YKkCCzGds2.)
         = $1$13NETowd$SeAArtswHd8jzc9SQvH691




                                                  Inspiring people to
Passwörter sicher speichern mit saltedpasswords   share
Weblinks
     Free Rainbow Tables
     http://www.freerainbowtables.com

     PHPASS
     http://www.openwall.com/phpass/

     PHP Manual: crypt()
     http://de2.php.net/manual/en/function.crypt.php

     Wikipedia: crypt (Unix)
     http://en.wikipedia.org/wiki/Crypt_(Unix)#Library_Function




                                                       Inspiring people to
Passwörter sicher speichern mit saltedpasswords        share
?????
                                    ??
                                   ?
                                   ??
                                 ??
                                 ?


                                                  Inspiring people to
Passwörter sicher speichern mit saltedpasswords   share
inspiring people to share.

Weitere ähnliche Inhalte

Andere mochten auch

2015 06-30 ho-r_2ndscreen@lrft
2015 06-30 ho-r_2ndscreen@lrft2015 06-30 ho-r_2ndscreen@lrft
2015 06-30 ho-r_2ndscreen@lrftLokalrundfunktage
 
Geschäftsmodelle im internet der dienste trends und entw
Geschäftsmodelle im internet der dienste   trends und entwGeschäftsmodelle im internet der dienste   trends und entw
Geschäftsmodelle im internet der dienste trends und entwNico Weiner
 
Projekt Portfolio - Bisherige Projekte
Projekt Portfolio - Bisherige ProjekteProjekt Portfolio - Bisherige Projekte
Projekt Portfolio - Bisherige ProjekteClaire Oberwinter
 
Othello | Mottingers-Meinung.at
Othello | Mottingers-Meinung.atOthello | Mottingers-Meinung.at
Othello | Mottingers-Meinung.atAlexander Rossi
 
Workshop social-media-dashboard 2010-3-25
Workshop social-media-dashboard 2010-3-25Workshop social-media-dashboard 2010-3-25
Workshop social-media-dashboard 2010-3-25Twittwoch e.V.
 
Safety Signs Total Construction
Safety Signs Total ConstructionSafety Signs Total Construction
Safety Signs Total ConstructionLiam Strettton
 
Fh wien optimierung ikt einsatz im tourismus 1 strategie
Fh wien optimierung ikt einsatz im tourismus 1 strategieFh wien optimierung ikt einsatz im tourismus 1 strategie
Fh wien optimierung ikt einsatz im tourismus 1 strategieMartin Schobert
 
Social Media Marketing für die gute Sache | Agentur Nest, Daniel Kruse | 15. ...
Social Media Marketing für die gute Sache | Agentur Nest, Daniel Kruse | 15. ...Social Media Marketing für die gute Sache | Agentur Nest, Daniel Kruse | 15. ...
Social Media Marketing für die gute Sache | Agentur Nest, Daniel Kruse | 15. ...Twittwoch e.V.
 
IT-Forum Rhein-Neckar - Präsentation des Netzwerks
IT-Forum Rhein-Neckar - Präsentation des NetzwerksIT-Forum Rhein-Neckar - Präsentation des Netzwerks
IT-Forum Rhein-Neckar - Präsentation des NetzwerksIT-Forum Rhein-Neckar e. V.
 
Senarai semak psk t2
Senarai semak psk t2Senarai semak psk t2
Senarai semak psk t2mudrik295
 
Präsentation schiff spa camp
Präsentation schiff  spa campPräsentation schiff  spa camp
Präsentation schiff spa campSonjaSchiff
 
Praxisbeispiel der Stadt Frankfurt Twittwoch Frankfurt
Praxisbeispiel der Stadt Frankfurt Twittwoch FrankfurtPraxisbeispiel der Stadt Frankfurt Twittwoch Frankfurt
Praxisbeispiel der Stadt Frankfurt Twittwoch FrankfurtTwittwoch e.V.
 
Pemerintah kab. bantaeng
Pemerintah kab. bantaengPemerintah kab. bantaeng
Pemerintah kab. bantaengsmpn05makassar
 
Was ist Information Governance?
Was ist Information Governance?Was ist Information Governance?
Was ist Information Governance?Humoback
 

Andere mochten auch (20)

Akku für Asus A42-G74
Akku für Asus A42-G74Akku für Asus A42-G74
Akku für Asus A42-G74
 
Bowlingcenter Schillerpark Werbeangebot
Bowlingcenter Schillerpark WerbeangebotBowlingcenter Schillerpark Werbeangebot
Bowlingcenter Schillerpark Werbeangebot
 
2015 06-30 ho-r_2ndscreen@lrft
2015 06-30 ho-r_2ndscreen@lrft2015 06-30 ho-r_2ndscreen@lrft
2015 06-30 ho-r_2ndscreen@lrft
 
Geschäftsmodelle im internet der dienste trends und entw
Geschäftsmodelle im internet der dienste   trends und entwGeschäftsmodelle im internet der dienste   trends und entw
Geschäftsmodelle im internet der dienste trends und entw
 
Projekt Portfolio - Bisherige Projekte
Projekt Portfolio - Bisherige ProjekteProjekt Portfolio - Bisherige Projekte
Projekt Portfolio - Bisherige Projekte
 
Othello | Mottingers-Meinung.at
Othello | Mottingers-Meinung.atOthello | Mottingers-Meinung.at
Othello | Mottingers-Meinung.at
 
Katrin steinert
Katrin steinertKatrin steinert
Katrin steinert
 
Rachel1
Rachel1Rachel1
Rachel1
 
Workshop social-media-dashboard 2010-3-25
Workshop social-media-dashboard 2010-3-25Workshop social-media-dashboard 2010-3-25
Workshop social-media-dashboard 2010-3-25
 
Safety Signs Total Construction
Safety Signs Total ConstructionSafety Signs Total Construction
Safety Signs Total Construction
 
Fh wien optimierung ikt einsatz im tourismus 1 strategie
Fh wien optimierung ikt einsatz im tourismus 1 strategieFh wien optimierung ikt einsatz im tourismus 1 strategie
Fh wien optimierung ikt einsatz im tourismus 1 strategie
 
Social Media Marketing für die gute Sache | Agentur Nest, Daniel Kruse | 15. ...
Social Media Marketing für die gute Sache | Agentur Nest, Daniel Kruse | 15. ...Social Media Marketing für die gute Sache | Agentur Nest, Daniel Kruse | 15. ...
Social Media Marketing für die gute Sache | Agentur Nest, Daniel Kruse | 15. ...
 
IT-Forum Rhein-Neckar - Präsentation des Netzwerks
IT-Forum Rhein-Neckar - Präsentation des NetzwerksIT-Forum Rhein-Neckar - Präsentation des Netzwerks
IT-Forum Rhein-Neckar - Präsentation des Netzwerks
 
Senarai semak psk t2
Senarai semak psk t2Senarai semak psk t2
Senarai semak psk t2
 
Präsentation schiff spa camp
Präsentation schiff  spa campPräsentation schiff  spa camp
Präsentation schiff spa camp
 
Dipsss
DipsssDipsss
Dipsss
 
Praxisbeispiel der Stadt Frankfurt Twittwoch Frankfurt
Praxisbeispiel der Stadt Frankfurt Twittwoch FrankfurtPraxisbeispiel der Stadt Frankfurt Twittwoch Frankfurt
Praxisbeispiel der Stadt Frankfurt Twittwoch Frankfurt
 
Diaeten
DiaetenDiaeten
Diaeten
 
Pemerintah kab. bantaeng
Pemerintah kab. bantaengPemerintah kab. bantaeng
Pemerintah kab. bantaeng
 
Was ist Information Governance?
Was ist Information Governance?Was ist Information Governance?
Was ist Information Governance?
 

Mehr von Steffen Gebert

Building an IoT SuperNetwork on top of the AWS Global Infrastructure
Building an IoT SuperNetwork on top of the AWS Global InfrastructureBuilding an IoT SuperNetwork on top of the AWS Global Infrastructure
Building an IoT SuperNetwork on top of the AWS Global InfrastructureSteffen Gebert
 
Wenn selbst ‘erlaube allen Verkehr von 0.0.0.0/0’ nicht hilft - Verbindungspr...
Wenn selbst ‘erlaube allen Verkehr von 0.0.0.0/0’ nicht hilft - Verbindungspr...Wenn selbst ‘erlaube allen Verkehr von 0.0.0.0/0’ nicht hilft - Verbindungspr...
Wenn selbst ‘erlaube allen Verkehr von 0.0.0.0/0’ nicht hilft - Verbindungspr...Steffen Gebert
 
Feature Management Platforms
Feature Management PlatformsFeature Management Platforms
Feature Management PlatformsSteffen Gebert
 
Serverless Networking - How We Provide Cloud-Native Connectivity for IoT Devices
Serverless Networking - How We Provide Cloud-Native Connectivity for IoT DevicesServerless Networking - How We Provide Cloud-Native Connectivity for IoT Devices
Serverless Networking - How We Provide Cloud-Native Connectivity for IoT DevicesSteffen Gebert
 
How our Cloudy Mindsets Approached Physical Routers
How our Cloudy Mindsets Approached Physical RoutersHow our Cloudy Mindsets Approached Physical Routers
How our Cloudy Mindsets Approached Physical RoutersSteffen Gebert
 
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Steffen Gebert
 
Jenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipelineJenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipelineSteffen Gebert
 
Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Steffen Gebert
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins PipelinesSteffen Gebert
 
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesSteffen Gebert
 
Let's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a CertificateLet's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a CertificateSteffen Gebert
 
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebSteffen Gebert
 
Investigating the Impact of Network Topology on the Processing Times of SDN C...
Investigating the Impact of Network Topology on the Processing Times of SDN C...Investigating the Impact of Network Topology on the Processing Times of SDN C...
Investigating the Impact of Network Topology on the Processing Times of SDN C...Steffen Gebert
 
SDN interfaces and performance analysis of SDN components
SDN interfaces and performance analysis of SDN componentsSDN interfaces and performance analysis of SDN components
SDN interfaces and performance analysis of SDN componentsSteffen Gebert
 
The Development Infrastructure of the TYPO3 Project
The Development Infrastructure of the TYPO3 ProjectThe Development Infrastructure of the TYPO3 Project
The Development Infrastructure of the TYPO3 ProjectSteffen Gebert
 
Der Weg zu TYPO3 CMS 6.0 und Einblicke in die TYPO3-Entwicklung
Der Weg zu TYPO3 CMS 6.0 und Einblicke in die TYPO3-EntwicklungDer Weg zu TYPO3 CMS 6.0 und Einblicke in die TYPO3-Entwicklung
Der Weg zu TYPO3 CMS 6.0 und Einblicke in die TYPO3-EntwicklungSteffen Gebert
 
Official typo3.org infrastructure &
the TYPO3 Server Admin Team
Official typo3.org infrastructure &
the TYPO3 Server Admin TeamOfficial typo3.org infrastructure &
the TYPO3 Server Admin Team
Official typo3.org infrastructure &
the TYPO3 Server Admin TeamSteffen Gebert
 

Mehr von Steffen Gebert (20)

Building an IoT SuperNetwork on top of the AWS Global Infrastructure
Building an IoT SuperNetwork on top of the AWS Global InfrastructureBuilding an IoT SuperNetwork on top of the AWS Global Infrastructure
Building an IoT SuperNetwork on top of the AWS Global Infrastructure
 
Wenn selbst ‘erlaube allen Verkehr von 0.0.0.0/0’ nicht hilft - Verbindungspr...
Wenn selbst ‘erlaube allen Verkehr von 0.0.0.0/0’ nicht hilft - Verbindungspr...Wenn selbst ‘erlaube allen Verkehr von 0.0.0.0/0’ nicht hilft - Verbindungspr...
Wenn selbst ‘erlaube allen Verkehr von 0.0.0.0/0’ nicht hilft - Verbindungspr...
 
Feature Management Platforms
Feature Management PlatformsFeature Management Platforms
Feature Management Platforms
 
Serverless Networking - How We Provide Cloud-Native Connectivity for IoT Devices
Serverless Networking - How We Provide Cloud-Native Connectivity for IoT DevicesServerless Networking - How We Provide Cloud-Native Connectivity for IoT Devices
Serverless Networking - How We Provide Cloud-Native Connectivity for IoT Devices
 
How our Cloudy Mindsets Approached Physical Routers
How our Cloudy Mindsets Approached Physical RoutersHow our Cloudy Mindsets Approached Physical Routers
How our Cloudy Mindsets Approached Physical Routers
 
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
 
Jenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipelineJenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipeline
 
Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous Delivery
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
Let's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a CertificateLet's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a Certificate
 
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
 
Investigating the Impact of Network Topology on the Processing Times of SDN C...
Investigating the Impact of Network Topology on the Processing Times of SDN C...Investigating the Impact of Network Topology on the Processing Times of SDN C...
Investigating the Impact of Network Topology on the Processing Times of SDN C...
 
SDN interfaces and performance analysis of SDN components
SDN interfaces and performance analysis of SDN componentsSDN interfaces and performance analysis of SDN components
SDN interfaces and performance analysis of SDN components
 
Git Power-Workshop
Git Power-WorkshopGit Power-Workshop
Git Power-Workshop
 
The Development Infrastructure of the TYPO3 Project
The Development Infrastructure of the TYPO3 ProjectThe Development Infrastructure of the TYPO3 Project
The Development Infrastructure of the TYPO3 Project
 
Der Weg zu TYPO3 CMS 6.0 und Einblicke in die TYPO3-Entwicklung
Der Weg zu TYPO3 CMS 6.0 und Einblicke in die TYPO3-EntwicklungDer Weg zu TYPO3 CMS 6.0 und Einblicke in die TYPO3-Entwicklung
Der Weg zu TYPO3 CMS 6.0 und Einblicke in die TYPO3-Entwicklung
 
Official typo3.org infrastructure &
the TYPO3 Server Admin Team
Official typo3.org infrastructure &
the TYPO3 Server Admin TeamOfficial typo3.org infrastructure &
the TYPO3 Server Admin Team
Official typo3.org infrastructure &
the TYPO3 Server Admin Team
 

TYPO3-Passwörter sicher speichern mit saltedpasswords

  • 1. Image: Carlos Porto / FreeDigitalPhotos.net TYPO3-Camp München - 11./12. September 2010 Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 2. Passwörter sicher speichern mit der Systemextension saltedpasswords Steffen Gebert <steffen@steffen-gebert.de> TYPO3-Camp München - 11./12. September 2010 Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 3. Einführung Vorstellung Steffen Gebert Student, Freelancer TYPO3 Core Team Member Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 4. Einführung Upps.. TYPO3 Assicciation, 3rd Quarterly Report 2008 “What happened? An unauthorized person gained administrative access to the typo3.org website. As far as we can tell, an admin password was stolen and used to find out more passwords on typo3.org.” Speicherung sensibler Daten (z.B. Passwörter) bestmöglichst vermeiden! Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 5. Einführung Speicherung von Passwörtern Absolutes No-Go: Speicherung des Klartextpassworts Stattdessen Speicherung eines Hashes (“Prüfsumme”) Bei Login nur Vergleich mit dieser Prüfsumme Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 6. Einführung Grundlagen Hashing Einwegfunktion gleiche Eingabe => gleiches Ergebnis md5(‘joh316’) = ‘bacb98acf97e0b6112b1d1b650b84971’ Rückrichtung algorithmisch nicht möglich Meistgenutzter Algorithmus: MD5 gilt nicht mehr als sicher (Kollisionen relativ einfach, riesige Rainbowtables verfügbar) Alternativen (SHA) liefern nur größeren Ergebnisraum => Verschiebung des Problems auf neue Rainbowtables Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 7. Einführung Abspeichern eines salted Passworts Benutzereingabe: ‘joh316’ Salt generieren, z.B. ‘7deb882cf’ Berechnung des Hashes md5(‘7deb882cf’ . ‘joh316’) = ‘bacedc598493cb316044207d95f7ad54’ Abspeichern von Salt und Hash Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 8. Einführung Überprüfen eines Passworts Benutzereingabe: ‘joh316’ Genutztes Salt aus Datenbank auslesen: ‘7deb882cf’ Berechnung des Hashes md5(‘7deb882cf’ . ‘joh316’) = ‘bacedc598493cb316044207d95f7ad54’ Vergleich mit abgespeichertem Hash Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 9. Die Extension Systemextension saltedpasswords Ursprünglich t3sec_saltedpasswords von Marcus Krause Aufnahme in den Core in Version 4.3 mit Hilfe von Steffen Ritter Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 10. Die Extension Implementierte salting-Methoden Salted MD5 Portable PHP password hashing framework Verfügbar für diverse PHP Applikationen (Drupal etc.) Wiederholte Anwendung von MD5 (langsam) Blowfish Verfügbarkeit systemabhängig Ab PHP 5.3 eigene Implementierung Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 11. Die Extension Der Knackpunkt Passwort muss im Klartext vorliegen TYPO3 übermittelt standardmäßig nur MD5-Hash Klartextübertragung jedoch unsicher Voraussetzung (mind. eine) SSL-Verbindung Systemextension rsaauth Verschlüsselt Passwörter vor Übertragung mit RSA-Algorithmus Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 12. Installation & Konfiguration rsaauth Voraussetzungen OpenSSL: PHP-Erweiterung empfohlen, Binary als Fallback JavaScript Aktivierung Frontend $TYPO3_CONF_VARS[FE][loginSecurityLevel] = ‘rsa’ Backend $TYPO3_CONF_VARS[BE][loginSecurityLevel] = ‘rsa’; Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 13. Installation & Konfiguration saltedpasswords mit SSL-Verbindung Frontend $TYPO3_CONF_VARS[FE][loginSecurityLevel] = ‘normal’ Backend $TYPO3_CONF_VARS[BE][lockSSL] > 0 Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 14. Installation & Konfiguration Installation saltedpasswords Prüft Verfügbarkeit von rsaauth oder lockSSL Aktivierung für FE / BE getrennt Wahl des Hashing-Algorithmus Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 15. Kompatibilität Abwärtskompatibilität Existierende Passwörter? (unsalted MD5) können nicht sofort konvertiert werden, da nicht im Klartext abgespeichert einzig möglicher Zeitpunkt: während Login Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 16. Kompatibilität Extensions Frontend felogin kompatibel srfeuserregister_t3secsaltedpw Alternative FE-User Registrierungen? Ggf. Anpassungen nötig (Single-Signon etc.) Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 17. Hintergrundwissen Passwortformate MD5 ohne Salt (zur Erinnerung) bacb98acf97e0b6112b1d1b650b84971 MD5 mit Salt beginnt mit $1$, 12 Zeichen Salt $1$13NETowd$WFpl6npZF71YKkCCzGds2. Blowfish beginnt mit $2a$, 22 Zeichen Salt $2a$07$DZpLLz7wtIfhSSMwyEXjA.Nbh6rpDlqbgwVKa.IoDLyuLe5C7Jp8W PHPASS beginnt mit $P$ $P$Ccw7UIZ..SkvKBXDWnZlZ.qHcbktrB. Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 18. Hintergrundwissen Passwortformate Pro & Contra PHPASS niedrige Systemvoraussetzungen (zu jeder PHP-Version kompatibel) setzt PHPASS-Implementierung in Applikation voraus MD5 / Blowfish Unix crypt() Format, kompatibel zu Systemdiensten (/etc/passwd) vielleicht doch die bessere Wahl (?) Algorithmen von PHP/System abhängig mit PHP 5.3.2 auch SHA-256/512 möglich Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 19. Hintergrundwissen Nutzung von crypt() [3] Passwortüberprüfung: crypt($user_input, $encrypted_password) == $encrypted_password); Gespeicherter Hash (incl. Salt): $1$13NETowd$WFpl6npZF71YKkCCzGds2. crypt(joh316, $1$13NETowd$WFpl6npZF71YKkCCzGds2.) = $1$13NETowd$WFpl6npZF71YKkCCzGds2. crypt(password, $1$13NETowd$WFpl6npZF71YKkCCzGds2.) = $1$13NETowd$SeAArtswHd8jzc9SQvH691 Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 20. Weblinks Free Rainbow Tables http://www.freerainbowtables.com PHPASS http://www.openwall.com/phpass/ PHP Manual: crypt() http://de2.php.net/manual/en/function.crypt.php Wikipedia: crypt (Unix) http://en.wikipedia.org/wiki/Crypt_(Unix)#Library_Function Inspiring people to Passwörter sicher speichern mit saltedpasswords share
  • 21. ????? ?? ? ?? ?? ? Inspiring people to Passwörter sicher speichern mit saltedpasswords share