Flashcards
Cryptography
Flashcards do conjunto (24)
- 1What is the main namespace of the cryptography classes?System.Security.Cryptography
- 2What is a symmetric algorithm?It's an algorithm that uses the same key to encrypt and decrypt the data.
- 3What is an asymmetric algorithm?It's an algorithm that has different keys for encrypt and decrypt data.
- 4What is a hash function?It's any function that maps any size of data to a fixed size of data, that's what we call hash value.
- 5What type of encryption algorithm is faster?Symmetric algorithms are faster than assymetric ones.
- 6What are the symmetric algorithms implementations available on the .NET Framework?AESCryptoServiceProvider(Advanced Encryption Stadard
AESManaged
RijndaelManaged
DESCryptoServiceProvider (Data Encryption Standard)
RC2CryptoServiceProvider
TripleDESCryptoServiceProvider(Triple Data Encryption Standard) - 7Why do you have to explicitly call the Clear() method of the Encryption object after used it?That's because it will erase any sensitive data that may remain in the memory.
- 8Why some implementations have the suffix "CryptoServiceProvider" and others "Managed"?Managed - That means the algorithm implementation is not certified by the FIPS and somewhat slower than other implementations
CryptoServiceProvider - They are called Cryptography API and these are only wrappers for that. These implementations are no longer being developed and they are suittable for old systems. - 9What does the CNG mean?It's an acronym for Cryptography of the Next Generation API. The algorithms from this api are suffixed with CNG and they are only compatible with Windows Vista an newer versions.
- 10What are the steps to encrypt/decrypt in a Stream?1. Create a Symmetric algorithm
2.Create the Encryptor Object by calling the CreateEncryptor method passing the algorithm object
3.Create a CryptoStream object with a stream + encryptor object + CryptoStreamMode.Write/Read
4.Using the CryptoStream you call the Write/Read method in order to encrypt
5. Call the CryptoStream.Clear method and return the MemoryStrem.ToArray() - 11What is a PKI?It's a Public Key Infrastructure.
- 12What is a digital certificate?It's when a CA(Certificate Authority) defines a public key to an identity. By doing this you can make sure the authenticity of the sender.
- 13What is the standard implementation of a PKI?It's the X.509 standard.
- 14What is the tool that helps to create certificates?MakeCert.exe
- 15How do you get the local machine registred certificates?1: You have to instantiate an X509Store object to access the location. You pass the name and location
2: Select how you're going to open it passing OpenFlags
3: Iterate on the Certificates property - 16How to protect the shared and private keys?You can use the DataProtectionScope, define CurrentUser or LocalMachine. The first one will grant access only to the logged user, the another one allows any user of the machine.
- 17What is the Microsoft list of recommended algorithms by application?Data Privacy - AES
Data Integrity - HMACSHA256 or HMACSHA512
Digital Signatures - RSA or ECDsa
Key Exchanges - RSA or ECDiffieHellman
Randon Number Generation - RNGCryptoServiceProvider
For generate a key from Password - Rfc2898DeriveBytes - 18When not using a Stream, how to encrypt and decrypt data?You can use a Decryptor object and call the TransformFinalBlock.
- 19What does the PublisherMembershipCondition stand for? How to check an evidence?Determines whether an assembly belongs to a code group by testing its software publisher's Authenticode X.509v3 certificate. You must call the Check(Evidence) method.
- 20What are the assymetric algorithms implemented on .NET?RSA - CryptorServiceProvider
DSA - CryptoServiceProvider
ECDsa - CNG
ECDiffieHellman - CNG - 21What is the workflow to encrypt data using an assymetric algorithm?1. Obtain the public key
2. Generate an encryption object
3. Set the public key
4. Encrypt the data
5. Send the encrypted data - 22What is the workflow to decrypt data using assymetric algorithms?1. Get the encrypted data
2. Create an assymetric algorithm object
3. Set the private key
4. Decrypt the data - 23What are the hashing algorithms implemented on the .NET framework?SHA1, SHA256, SHA512, SHA384, MD5 and RIPEMD160
- 24What is the method to generate the hash?HashAlgorithm.ComputeHash(data);
TransformBlock and
TransformFinalBlock methods are used when you want to compute the hash for portions of your data.
Informações
- Descrição
- FlashCards sobre Cryptography, criado por Thiago Avelino em 12-01-2016.
- Criado por
- Thiago Avelino
- Visualizações
- 1
- Avaliação