encryption-symmetric

TLS handshake - Symmetric scheme

ⅰ亾dé卋堺 提交于 2019-12-11 02:26:56
问题 From what I can tell TLS works using both symmetric and assymmetric encryption. The assymmetric schemes are used to exchange keys but when and what symmetric schemes are used? 回答1: The asymmetric schemes are used to exchange keys and digital-signatures. The symmetric schemes are used to data transfer with the agreed symnetric key during the key-exchange. This is called Hybrid cryptosystem. 回答2: Yes you are right. Asymmetric algorithms are usually slower than the symmetric algorithms. However,

C Crypto Libraries Supporting HC-128/256?

痞子三分冷 提交于 2019-12-10 23:45:57
问题 I have been searching for a while for a crypto library that I can used on linux to implement HC-128/256 encryption for using on network traffic. Unfortunately, support for this seems rather rare. Bouncy Castle supports it for C# and Java, but I need it for C. I have the source code for the HC-128/256 algorithms, but no examples on how to actually use it. HC-256 Wikipedia: http://en.wikipedia.org/wiki/HC-256 HC-128 Source Code and Article: http://www.ecrypt.eu.org/stream/hcp3.html Any help?

BinaryFormatter & CryptoStream problem when deserializing

对着背影说爱祢 提交于 2019-12-10 18:59:12
问题 I'm getting a bit desperate here. I'm trying to write an encrypted file with a serialized object to disk and later retrieve the file, decrypt it and deserialize the object back. UPDATE: I refactored the code to this: using (Stream innerStream = File.Create(this.GetFullFileNameForUser(securityContext.User, applicationName))) { using (Stream cryptoStream = new CryptoStream(innerStream, GetCryptoProvider().CreateEncryptor(), CryptoStreamMode.Write)) { // 3. write to the cryptoStream /

Decrypt Rijndael 256 Block Size with BouncyCastle

拥有回忆 提交于 2019-12-10 18:16:07
问题 We have a helper class for doing encryption that, if I'm going to be honest, was probably copied from Stack Overflow years ago. Currently we're trying to port some of this code to .NET Core and we're finding that it doesn't work because the .NET Core implementation of RijndaelManaged doesn't support a 256 blocksize. From what I've read, it seems like BouncyCastle should still support it, but I can't get it to work. The "unencrypted" text is just a bunch of gibberish. I'm sure I'm doing

RsaProtectedConfigurationProvider implementation vs RSACryptoServiceProvider c#

微笑、不失礼 提交于 2019-12-10 11:53:08
问题 If RSACryptoServiceProvider cannot Encrypt data larger than it's KeySize, how RsaProtectedConfigurationProvider is implemented in the .Net framework? I am working on a utility that is going to be used to encrypt/decrypt some sensitive information. My two encryption provider options are DPAPI and RSA, while DPAPI not suited for web farm kind of environment, RSA is fits because of the Export/Import options with a KeyContainer. This is a stand alone application running on a workstation. As I am

C# AES Rijndael - detecting invalid passwords

半腔热情 提交于 2019-12-10 03:24:24
问题 I'm using Rijndael to encrypt some sensitive data in my program. When the user enters an incorrect password, most of the time a CryptographicException is thrown with the message "Padding is invalid and cannot be removed.". However, with very small probability, the CryptStream does not throw an exception with the wrong password, but instead gives back an incorrectly decrypted stream. In other words, it decrypts to garbage. Any idea how to detect/prevent this? The simplest way I can think of

How to Secure Private key(of Triple DES) in C# application?

微笑、不失礼 提交于 2019-12-09 23:59:33
问题 Tool : OS-Windows 7 64bit, Visual Studio 2012, 4.5 .NET Framework. Language : C#. I have created one console application. In this application I have used Data Encryption Algorithm (DES- Symmetric Algorithm) to encrypt and decrypt data. Now in this approach, Private or secrete key is used. I want to secure this key from client/Hack. How can I secure it? For now I have stored KEY to the registry, And read that key from registry to encryption and decryption when required. But from registry any

Fast, simple to use symmetric cipher for integer encryption in Java

你说的曾经没有我的故事 提交于 2019-12-09 06:49:40
问题 What is in Java a cipher function for integer encryption having these properties?: Fast Symmetric-key algorithm Simple to use (i.e. a couple of lines of code to use it and no external library to include) It is possible to specify the output length (e.g. 20 characters) I need to use it only to encrypt/decrypt integers. 回答1: The requirement for no external library reduces the list to DES, 3DES and AES. DES and 3DES have a block size of 64 bits whereas AES has a block size of 128 bits. There are

How does blowfish algorithm work in C++?

早过忘川 提交于 2019-12-08 11:58:22
问题 Hi All I have to encrypt my data using Blowfish algorithm in C++...can you guys tell me if the other end knows what algorithm I am using can they not extract the key and decrypt it ? How safe is the data by this method? 回答1: can you guys tell me if the other end knows what algorithm I am using can they not extract the key and decrypt it ? No. The whole point of standardized encryption algorithms (as opposed to those that rely on obscurity) is that even though everyone knows all details of it,

Can you do symmetric encryption on SAML attributes in SAML 2.0?

泪湿孤枕 提交于 2019-12-08 04:48:24
问题 Can you do symmetric encryption on SAML attributes in SAML 2.0? We can seem to do asymmetric. What are pros and cons? 回答1: SAML 2.0 utilizes XML Encryption (Sect 5.2.1 and 5.2.2). With that said, Sect 4.2 of the SAML 2.0 Conformance docs specifies you must support the following to be SAML 2.0 compliant: Block Encryption: TRIPLE DES, AES-128, AES-256. Key Transport: RSA-v1.5, RSA-OAEP In other words, SAML 2.0 mandates you use asymmetric keys. So, the "cons" will be that you are not SAML 2.0