Python Scripting - Week 12 Flashcards

1
Q

What is CIAN ?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What Cryptography Guaranties ?

A

It Guaranties CIAN
C - Confidentiality
I - Integrity
A - Authentication
N - Non-Repudiation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What Stands for CSPRNG ?

A

Crytographically Secure Pseudo-random Number Generators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the module for random number generation for cryptography ?

A

secret module library
import secret

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Write a program to select randon number from 10 numbers ?

A

import secrets
secrets.choice([1,10,45,23])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Write a program to get random number below from number ?

A

import secrets
secrets.randbelow(100)

This will generate single random number below 100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Write a program to get random number of n bits ?

A

import secrerts
secrets.randbits(100)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to create a string token ?

A

import secret
secrets.token_bytes(10)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to create a hexa string token ?

A

import secrets
secrets.token_hex(10)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to creare url safe token string ?

A

import secrets
secrets.token_urlsafe(15)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is symmetric cryptography ?

A

Sender and receiver of a message share a single common key that is used to encrypt and decrypt the message

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is asymmetric cryptography

A

Centre and receiver don’t have the same key, they have the public key and private key to encrypt or dcrypt the message

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the some symmetry key cryptography algorithms

A

These are ,
AES
DES
3DES
RC4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which module implements symmetric cryptography

A

fernet module

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Asymmetric Cryptography ?

A

Asymmetric cryptography is also called public-key cryptography, two different keys are used to encrypt and decrypt message.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a key in Cryptography ?

A

In cryptography, a key is a string of characters that are stored in a file, this file used by cryptographic algorithm to transform plain text into cipher text or vice versa.

17
Q

What is mean by public key and private key ?

A

Public key is used to encrypt the message, and private key is used to decrypt the message

18
Q

How to implement Cryptography in Python

A

We have to use Hazmat Layer,
Hazardous Material Layer

19
Q

What is Preimage resistance ?

A

It is a property of Hashing,
hash is very hard to reverse , means its hard to get plain text from hash.

20
Q

What is collision resistance ?

A

It is a property of Hashing,
No two inputs , give the same output