¡@

Home 

c# Programming Glossary: crypto

Is there a JSON Web Token (JWT) example in C#?

http://stackoverflow.com/questions/10055158/is-there-a-json-web-token-jwt-example-in-c

'.' var header parts 0 var payload parts 1 byte crypto Base64UrlDecode parts 2 var headerJson Encoding.UTF8.GetString.. bytesToSign var decodedCrypto Convert.ToBase64String crypto var decodedSignature Convert.ToBase64String signature if decodedCrypto..

Decrypting with private key from .pem file in c# with .NET crypto library

http://stackoverflow.com/questions/1162504/decrypting-with-private-key-from-pem-file-in-c-sharp-with-net-crypto-library

with private key from .pem file in c# with .NET crypto library I know this is a similar question to this one but before.. END RSA PRIVATE KEY directly with the .NET 3.5 crypto library without having to go to a 3rd party or roll my own .. to a 3rd party or roll my own c# javascript .net 3.5 rsacryptoserviceprovider share improve this question http www.jensign.com..

CryptographicException: Padding is invalid and cannot be removed

http://stackoverflow.com/questions/11762/cryptographicexception-padding-is-invalid-and-cannot-be-removed

deal of inspiration from here create and initialize a crypto algorithm private static SymmetricAlgorithm getAlgorithm string.. CryptoStream cs new CryptoStream ms algorithm.CreateEncryptor CryptoStreamMode.Write cs.Write clearBytes 0 clearBytes.Length.. CryptoStream cs new CryptoStream ms algorithm.CreateDecryptor CryptoStreamMode.Write cs.Write cipherBytes 0 cipherBytes.Length..

Why use the C# class System.Random at all instead of System.Security.Cryptography.RandomNumberGenerator?

http://stackoverflow.com/questions/1257299/why-use-the-c-sharp-class-system-random-at-all-instead-of-system-security-crypto

from System.Random at all instead of always using the cryptographically secure random number generator from System.Security.Cryptography.RandomNumberGenerator.. generators from Python Java and C# and to instead use the cryptographically secure version. I know the difference between the.. Why use System.Random at all Performance perhaps c# .net cryptography random share improve this question Speed and also..

Getting incorrect decryption value using AesCryptoServiceProvider

http://stackoverflow.com/questions/14937707/getting-incorrect-decryption-value-using-aescryptoserviceprovider

a IV in to Encrypt and assign it before you begin your crypto transform instead of letting aesProvider generate a random one.. encStream new CryptoStream memStream aesProvider.CreateEncryptor CryptoStreamMode.Write encStream.Write rawData 0 rawData.Length.. decStream new CryptoStream memStream aesProvider.CreateDecryptor CryptoStreamMode.Write decStream.Write encryptedMsg 0 encryptedMsg.Length..

How to import PKCS#8 RSA privateKey (created by OpenSSL) in C#

http://stackoverflow.com/questions/1722305/how-to-import-pkcs8-rsa-privatekey-created-by-openssl-in-c-sharp

the rest of the library it will make dealing with general crypto concepts a lot easier as well. And unlike the regular Microsoft..

Decrypt PHP encrypted string in C#

http://stackoverflow.com/questions/224453/decrypt-php-encrypted-string-in-c-sharp

tripleDes.Padding PaddingMode.Zeros ICryptoTransform crypto tripleDes.CreateDecryptor byte decodedInput Decoder input byte.. ICryptoTransform crypto tripleDes.CreateDecryptor byte decodedInput Decoder input byte decryptedBytes crypto.TransformFinalBlock.. byte decodedInput Decoder input byte decryptedBytes crypto.TransformFinalBlock decodedInput 0 decodedInput.Length return..

Why do I need to use the Rfc2898DeriveBytes class (in .NET) instead of directly using the password as a key or IV?

http://stackoverflow.com/questions/2659214/why-do-i-need-to-use-the-rfc2898derivebytes-class-in-net-instead-of-directly

used over the other alternative I have mentioned above c# cryptography rfc2898 share improve this question You really really.. really do not want to use a user password directly as a crypto key especially with AES. Rfc2898DeriveBytes is an implementation.. keys in different contexts is one of the most common ways cryptographic systems are broken. The multiple iterations 1000 by default..

Using AES encryption in C#

http://stackoverflow.com/questions/273452/using-aes-encryption-in-c-sharp

cc164846.aspx If you just want to use the built in crypto provider RijndaelManaged check out the following help article.. http msdn.microsoft.com en us library system.security.cryptography.rijndaelmanaged.aspx And just in case you need the sample.. to perform the stream transform. ICryptoTransform encryptor rijAlg.CreateEncryptor rijAlg.Key rijAlg.IV Create the streams..

Rewrite Rijndael 256 C# Encryption Code in PHP

http://stackoverflow.com/questions/3505453/rewrite-rijndael-256-c-sharp-encryption-code-in-php

parameters. symmetricKey.Mode CipherMode.CBC Generate encryptor from the existing key bytes and initialization vector. Key.. based on the number of the key bytes. ICryptoTransform encryptor symmetricKey.CreateEncryptor keyBytes initVectorBytes.. key bytes. ICryptoTransform encryptor symmetricKey.CreateEncryptor keyBytes initVectorBytes Define memory stream which will..

How can I create a Product Key for my C# App

http://stackoverflow.com/questions/453030/how-can-i-create-a-product-key-for-my-c-sharp-app

want to bind it to a user . Then encrypt that using some crypto algorithm with a fixed key or hash it. Then you just verify..

RNGCryptoServiceProvider - Random Number Review

http://stackoverflow.com/questions/4892588/rngcryptoserviceprovider-random-number-review

using RNGCryptoServiceProvider gives you an unguessable crypto strength seed whereas Environment.TickCount is in theory predictable... will seed the Random object with a different crypto strength number each time meaning that it will go on to return..

openssl using only .NET classes

http://stackoverflow.com/questions/5452422/openssl-using-only-net-classes

enoughBytesForKey false See http www.openssl.org docs crypto EVP_BytesToKey.html#KEY_DERIVATION_ALGORITHM while enoughBytesForKey.. Mode CipherMode.CBC KeySize 256 BlockSize 256 Create an encryptor to perform the stream transform. ICryptoTransform encryptor.. to perform the stream transform. ICryptoTransform encryptor aesAlg.CreateEncryptor aesAlg.Key aesAlg.IV Create the streams..

Why are RijndaelManaged and AesCryptoServiceProvider returning different results?

http://stackoverflow.com/questions/957388/why-are-rijndaelmanaged-and-aescryptoserviceprovider-returning-different-results

TransformData unencryptedData mEncryptionType.CreateEncryptor mPrivateKey mInitializationVector private byte TransformData.. byte TransformData byte dataToTransform ICryptoTransform cryptoTransform byte result new byte 0 if dataToTransform null &&.. byte result new byte 0 if dataToTransform null && cryptoTransform null && dataToTransform.Length 0 Create the memory..

How can I generate truly (not pseudo) random numbers with C#?

http://stackoverflow.com/questions/1234094/how-can-i-generate-truly-not-pseudo-random-numbers-with-c

The Easy Way for simplicity practicality The RNGCryptoServiceProvider which is part of the Crypto API in the BCL should.. The RNGCryptoServiceProvider which is part of the Crypto API in the BCL should do the job for you. It's still technically.. hardware of course. I suspect the practical solution RNGCryptoServiceProvider or such should do the job perfectly well for..

Why use the C# class System.Random at all instead of System.Security.Cryptography.RandomNumberGenerator?

http://stackoverflow.com/questions/1257299/why-use-the-c-sharp-class-system-random-at-all-instead-of-system-security-crypto

C# class System.Random at all instead of System.Security.Cryptography.RandomNumberGenerator Why would anybody use the standard.. secure random number generator from System.Security.Cryptography.RandomNumberGenerator or its subclasses because RandomNumberGenerator.. Nate Lawson tells us in his Google Tech Talk presentation Crypto Strikes Back at minute 13 11 not to use the standard random..

Encrypt SQLite database in C#

http://stackoverflow.com/questions/1259561/encrypt-sqlite-database-in-c-sharp

Encrypt/Decrypt string in .NET

http://stackoverflow.com/questions/202011/encrypt-decrypt-string-in-net

28v vs.95 29.aspx Good luck public class Crypto private static byte _salt Encoding.ASCII.GetBytes o6806642kbM7c5.. 8 Create a decryptor to perform the stream transform. ICryptoTransform encryptor aesAlg.CreateEncryptor aesAlg.Key aesAlg.IV.. int msEncrypt.Write aesAlg.IV 0 aesAlg.IV.Length using CryptoStream csEncrypt new CryptoStream msEncrypt encryptor CryptoStreamMode.Write..

Encryption compatable between Android and C#

http://stackoverflow.com/questions/2090765/encryption-compatable-between-android-and-c-sharp

javax.crypto.spec. import android.util.Log public class Crypto public static final String TAG smsfwd private static Cipher.. private static String MESSAGEDIGEST_ALGORITHM MD5 public Crypto String passphrase byte passwordKey encodeDigest passphrase try.. class using System using System.Text using System.Security.Cryptography namespace smsfwdClient public class Crypto private ICryptoTransform..

An effective method for encrypting a license file?

http://stackoverflow.com/questions/359342/an-effective-method-for-encrypting-a-license-file

Signed assembly to retrieve the key from param returns RSA Crypto Service Provider initialised with the key from the assembly.. with the key from the assembly returns public static RSACryptoServiceProvider GetPublicKeyFromAssembly Assembly assembly if.. rsaParams EncryptionUtils.GetRSAParameters pubkey RSACryptoServiceProvider rsa new RSACryptoServiceProvider rsa.ImportParameters..

Why are RijndaelManaged and AesCryptoServiceProvider returning different results?

http://stackoverflow.com/questions/957388/why-are-rijndaelmanaged-and-aescryptoserviceprovider-returning-different-results

are RijndaelManaged and AesCryptoServiceProvider returning different results Here is the example.. 0x3d 0xc6 0x16 0x2b 0xd8 0xb5 0xd9 0x12 0x85 Using the AesCryptoServiceProvider produces an encrypted value of 0x8d 0x9f 0x6e.. rij_encrypted_data Encrypt mData mEncryptionType new AesCryptoServiceProvider mEncryptionType.Mode CipherMode.CFB mEncryptionType.Padding..