encryption-symmetric

Symmetric Bijective Algorithm for Integers

帅比萌擦擦* 提交于 2019-11-27 06:58:31
I need an algorithm that can do a one-to-one mapping (ie. no collision) of a 32-bit signed integer onto another 32-bit signed integer. My real concern is enough entropy so that the output of the function appears to be random. Basically I am looking for a cipher similar to XOR Cipher but that can generate more arbitrary-looking outputs. Security is not my real concern, although obscurity is. Edit for clarification purpose: The algorithm must be symetric, so that I can reverse the operation without a keypair. The algorithm must be bijective, every 32-bit input number must generate a 32-bit

Simple code to encrypt an .INI file string using a password

回眸只為那壹抹淺笑 提交于 2019-11-27 05:47:40
问题 I am looking for something more sophisticated than ROT13, but which does not require a library (preferablly not even a unit, just a drop in function). I want to symetrically encrypt/decrypt a given string with a password provided by the user. However, the result has to be a string, in the sense that it I have to be able to store it in an .INI file. Does anyone have a simple function to do this (delphi XE2)? Google is not my friend today. Thanks in advance [Update] / [Bounty] Just to make it

C# Encryption to PHP Decryption

孤人 提交于 2019-11-27 04:05:54
I'm trying to encrypt some (cookie) data in C# and then decrypt it in PHP. I have chosen to use Rijndael encryption. I've almost got it working, except only part of the text is decrypted! I started working from this example: Decrypt PHP encrypted string in C# Here's the text (JSON) that I am encrypting (sensitive information removed): {"DisplayName":"xxx", "Username": "yyy", "EmailAddress":"zzz"} So I login to the C# app which creates/encodes the cookie from stored Key and IV and then redirects to the PHP app which is supposed to decrypt/read the cookie. When I decrypt the cookie, it comes out

Symmetric Encryption (AES): Is saving the IV and Salt alongside the encrypted data safe and proper?

六眼飞鱼酱① 提交于 2019-11-27 02:34:48
问题 I am trying to make sense of how to handle and manage an initilization vector and salt (when applicable) when encrypting and decrypting data using a symmetric encryption algorithm, in this case AES. I have deduced from different SO threads and various other websites that neither the IV or salt need to be secret, only unique in order to defend against cryptanalytic attacks such as a brute-force attack. With this in mind I figured that it would be viable to store my pseudo random IV with the

Simple Encryption in Ruby without external gems

感情迁移 提交于 2019-11-27 01:00:31
问题 I need a simple encryption for some text strings. I want to create coupon codes and make them look cool so subsequently created code should look very different. (And besides looking cool, it shouldn't be easy to guess a code.) But I want to be able to decrypt them again. So the algorithm must be reversible. I alread tried some stuff with moving bits around so they look kind of random already. But two subsequent codes (just one bit different) of course look very similar. Any suggestions? I

PyCrypto problem using AES+CTR

房东的猫 提交于 2019-11-26 23:21:57
问题 I'm writing a piece of code to encrypt a text using symmetric encryption. But it's not coming back with the right result... from Crypto.Cipher import AES import os crypto = AES.new(os.urandom(32), AES.MODE_CTR, counter = lambda : os.urandom(16)) encrypted = crypto.encrypt("aaaaaaaaaaaaaaaa") print crypto.decrypt(encrypted) Here, the decrypted text is different from the original. I don't really understand much about cryptography so please bear with me. I understand the CTR mode requires a

Symmetric Bijective Algorithm for Integers

余生颓废 提交于 2019-11-26 13:00:03
问题 I need an algorithm that can do a one-to-one mapping (ie. no collision) of a 32-bit signed integer onto another 32-bit signed integer. My real concern is enough entropy so that the output of the function appears to be random. Basically I am looking for a cipher similar to XOR Cipher but that can generate more arbitrary-looking outputs. Security is not my real concern, although obscurity is. Edit for clarification purpose: The algorithm must be symetric, so that I can reverse the operation

Differences Between Rijndael and AES

我的未来我决定 提交于 2019-11-26 11:08:47
问题 I\'m investigating encryption algorithms - can someone give me a quick rundown of the differences between Rijndael and AES? 回答1: AES is a United States federal standard, FIPS 197, which is a subset of Rijndael: AES has a fixed block size of 128 bits and a key size of 128, 192, or 256 bits, whereas Rijndael can be specified with block and key sizes in any multiple of 32 bits, with a minimum of 128 bits and a maximum of 256 bits. From Advanced Encryption Standard on Wikipedia. 回答2: Strictly

C# Encryption to PHP Decryption

坚强是说给别人听的谎言 提交于 2019-11-26 11:04:40
问题 I\'m trying to encrypt some (cookie) data in C# and then decrypt it in PHP. I have chosen to use Rijndael encryption. I\'ve almost got it working, except only part of the text is decrypted! I started working from this example: Decrypt PHP encrypted string in C# Here\'s the text (JSON) that I am encrypting (sensitive information removed): {\"DisplayName\":\"xxx\", \"Username\": \"yyy\", \"EmailAddress\":\"zzz\"} So I login to the C# app which creates/encodes the cookie from stored Key and IV

PHP AES encrypt / decrypt

前提是你 提交于 2019-11-26 00:46:23
问题 I found an example for en/decoding strings in PHP. At first it looks very good but it wont work :-( Does anyone know what the problem is? $Pass = \"Passwort\"; $Clear = \"Klartext\"; $crypted = fnEncrypt($Clear, $Pass); echo \"Encrypted: \".$crypted.\"</br>\"; $newClear = fnDecrypt($crypted, $Pass); echo \"Decrypted: \".$newClear.\"</br>\"; function fnEncrypt($sValue, $sSecretKey) { return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $sSecretKey, $sDecrypted, MCRYPT_MODE_ECB, mcrypt