Académique Documents
Professionnel Documents
Culture Documents
Python Chapitre 5 Hachage-F
Python Chapitre 5 Hachage-F
TEK-UP
1 Introduction
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024
Introduction
Introduction
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024
Introduction
Notion Hachage
Exemple d’utilisation:
Le stockage de mots de passe et d'autres informations sensibles dans des
bases de données ou des fichiers de code source. Dans de tels cas, il est
plus sûr d'exécuter l'algorithme de hachage sur les informations sensibles
et de stocker le hachage au lieu de l'information.
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024
Introduction
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024
Introduction
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024
Introduction
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024
Introduction
Résistance aux collisions: il doit être difficile (ou infaisable sur le plan
informatique) de trouver deux chaînes de messages différentes m1 et m2
de sorte que le hachage de m1 soit égal à celui de m2. Cette propriété est
appelée résistance aux collisions.
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024
Module Python Hashlib
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024
Module Python Hashlib
Définition
import hashlib
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024
Module Python Hashlib
print(hashlib.algorithms_available)
print(hashlib.algorithms_guaranteed)
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024
Module Python Hashlib
La méthode Python string encode() est utilisée pour coder la chaîne à l'aide
de l'encodage fourni. Cette fonction renvoie l'objet bytes. Si nous ne
fournissons pas d'encodage, l'encodage "utf-8" est utilisé par défaut.
Syntaxe:
La méthode Python string decode() est utilisée pour convertir des octets en
objet chaîne.
Syntaxe:
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024
Module Python Hashlib
# coding: utf-8
Text = 'Test Codage - Decodage'
Text1= b'Test Codage - Decodage'
encodeBytes = Text.encode(encoding='utf-8') # ou = 'ascii'
print(encodeBytes)
print(type(encodeBytes))
Text_decode = encodeBytes.decode()
print(type(Text_decode))
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024
Module Python Hashlib
import hashlib
# La chaîne de caractères à hasher
string_to_hash = "Tek-UP is My University"
Rihem Ben Romdhane & Mohamed Wajih Guerfala TEK-UP A.U: 2023 -2024