Python Scripting - Week 12 Flashcards
What is CIAN ?
C - Confidentiality
I - Integrity
A - Authentication
N - Non-Repudiation
Confidentiality means Privacy
Integrity means Unchanged Data
Authentication means data is not coming from someone else
Non-repudiation means , you cant deny anything
What Cryptography Guaranties ?
It Guaranties CIAN
C - Confidentiality
I - Integrity
A - Authentication
N - Non-Repudiation
What Stands for CSPRNG ?
Crytographically Secure Pseudo-random Number Generators
What is the module for random number generation for cryptography ?
secret module library
import secret
Write a program to select randon number from 10 numbers ?
import secrets
secrets.choice([1,10,45,23])
Write a program to get random number below from number ?
import secrets
secrets.randbelow(100)
This will generate single random number below 100
Write a program to get random number of n bits ?
import secrerts
secrets.randbits(100)
How to create a string token ?
import secret
secrets.token_bytes(10)
How to create a hexa string token ?
import secrets
secrets.token_hex(10)
How to creare url safe token string ?
import secrets
secrets.token_urlsafe(15)
What is symmetric cryptography ?
Sender and receiver of a message share a single common key that is used to encrypt and decrypt the message
What is asymmetric cryptography
Centre and receiver don’t have the same key, they have the public key and private key to encrypt or dcrypt the message
What are the some symmetry key cryptography algorithms
These are ,
AES
DES
3DES
RC4
Which module implements symmetric cryptography
fernet module
What is Asymmetric Cryptography ?
Asymmetric cryptography is also called public-key cryptography, two different keys are used to encrypt and decrypt message.