encryption

Given the session key and secret, how can we decrypt Rails cookies?

Hello all. I've got a question about how Rails handles cookie encryption/decryption. I've got this in my config/environment.rb config.action_controller.session = { :session_key => [some key], :secret => [some secret] } And this in config/environment/production.rb et al.: ActionController::Base.session_options[:session_...

Encrypt a filename in C# without including unusable chars in the resulting string

I want to encrypt a filename but ensure that the encrypted filename doesn't contain any of the characters that are not allowed (on a windows system) in filenames. The string also needs to be able to be decrypted back to the original filename (so you can't just filter out the invalid characters after the encryption). To my knowledge the...

How can I encrypt with AES in C# then decrypt it on Perl?

Here is my C# code. How could I decrypt this in Perl? Or I cannot decypt it in Perl due to OpenSSL? RijndaelManaged RijndaelAlg = new RijndaelManaged(); FileStream fStream = File.Open(FileName, FileMode.OpenOrCreate); byte[] initVectorBytes = Encoding.ASCII.GetBytes("11B2c3D4e5F6g7H8"); RijndaelAlg.IV = initVectorBytes; string password ...

how do I encrypt and then decrypt the text of username and password used in database class file

Hello everybody, I have created a class file database.php which handles all the sql queries and connecting to database. I store username and password for the database in a variable (which is easily seen if one gains access to the php file). I want to encrypt that username and password so that even after having that php file one is not ...

Does IV work like salt

In AES, my understanding is salt is the stuff to make the passphrase more secure and it wont be added into encypted text. But IV is the stuff used to encypt first block of message and will be added into encypted text. Do I get anything wrong? Many Thanks. ...

securty issue XOR

is this password check algorithm safe to use in low security environment like local network static string keys = "qwertyuiopüõasdfghjklöäzxcvbnmQWERTYUIOPÜÄÖLKJHGFDSAZXCVBNM"; static Int64 key = 0; public static bool check(string input) { string tmp = ""; string encAnswer = "ỬốỒởỐỚ"; for (int i = 0;...

Encryption of a C++/CLI /clr DLL and Assembly.Load()

Hi, guys. I'm developing a client software for an online community I belong to. In order to let me write a client to it, the owners and webmasters demand my code to be encrypted (not just obfuscated). Most of my project is written in VB.NET (F3.5), and some of it is using SQLite and libcrypt via C++/CLI for performance reasons (so I cann...

iPhone: supported algorithm for Encryption /decryption

hi all, i am new to iPhone. i want to know which Encryption /decryption algorithm is supported by iPhone ? please suggest or provide me some helpful link ...

Storing AES keys

Hi. Is there a good way to ship AES keys together with the application, but still make them safe enough? I don't quite fond regarding the idea of hard-coding the keys (as the app can be de-compiled), but other alternative, saving them on remote server, looks quite dangerous to me in case the server goes down or the network cuts off. I...

XLinq with encrypted files?

How do I create/read/write XLinq and/or VB XML Literals from and to encrypted xml files? ...

Decrypting a file in Java and exporting it to a file without going into infinite loops?

How do you decrypt a file in java and export it to a file without having to end up in an infinite loop if you have more than one user and password. Here is my code and at the end is my test file: import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOE...

Encrypt SQL Server connection string

If one has a connectionstring in one's application, is there a way to encrypt the information it contains? The connection string is created using the SqlConnectionStringBuilder object. Or is it 'acceptable' that sensitive information is sent in plaintext to the server? ...

How bad is 3 as an RSA public exponent

I'm creating an application where I have to use RSA to encrypt some stuff using a public key. I want this encryption to be really fast. Initially, I tried a 2048 bit key with F4 (=65537) as the exponent but it is not fast enough. So now I'm considering the following 2 options: 2048 bit modulus, e=3 1024 bit modulus, e=65537 Both sati...

File based Spring Security

Hi, I'm working on a Web Service project to provide data to a partner. Our app is really light weight and has only a handful of APIs. Because of time constraint and in-house pre-existing knowledge we went the Spring MVC / Spring Security path to serve those restful APIs. At any rate this is a B2B project where we are expecting only t...

Problem encrypting/encoding URL variable

I have a class that takes a string in this format: 000067000000000012620060324b38e2cab3353 , encrypts the string then appends it as a get variable in a URL. The class that does the encryption has a function that looks like this: private function _code_encryption($enc_type,$a_string){ $iv_size = mcrypt_get_iv_size(MCRYPT_RIJND...

is there any block cipher that have a block size of 32 bit for use on .net?

well i want to encrypt 32bit integers so they are represented by another 32 bit integers i am currently using des but the resulst is 64bit integer. so is it possible to have a block cipher with 32 bit block so the output is 32bit integer? i don't want to use Xor Encryptions as a last resort :) thanks ...

How to encrypt mysql passwrod in php (or how to defeat automated code scanner red flag)

Management strikes again. How should I satisfy the code scanner that is going to read my php source and red flag my MySQL connection string? Linux Server (soon to be Sun) php 4.2 (soon to be latest version) MySQL database Servers in a DMZ outside of the firewall Read only MySQL account Not a single byte of non public information in t...

How to check whether decrypting was successful?

When using blowfish algorithm from openssl library, one can encrypt and decrypt any data. Furthermore any data can be encrypted (decrypted) with any key\iv. There is no way in openssl to tell whether decryption was successful or not. It's just some mathematical transformation. So, what should I do to be sure that encryption was success...

Revealing the length of the plain-text?

If I have just encrypted some plain-text into cipher-text with CBC and Rijndael, is it insecure to tell the world that the original plain-text had a length of x bytes? It seems that it's always the same as the length of the cipher-text, so, I think it does not matter, but are there some block modes or ciphers where it does matter? ...

encryption with php

how can i encrypt things with php using a key? I would prefer not to have to install Mcrypt. I also need the encryption to be pretty strong. ...