encryption

Encrypt and decrypt file in J2ME

Hi guys. I'm having problem decrypting an encrypted file in J2ME using bouncy castle. What I'm trying to do is select a file to encrypt,write the encrypted file and try decrypt it back to its orginal form (write to another file for verification purpose). I have this error when reading the encrypted file. Stack Trace : s: pad block cor...

Encrypted NSData to NSString in obj-c?

I have an iPhone app which encrypts an inputted NSString using CCCrypt (AES256) and a plaintext key. The string and key are given to the encryption method which returns an NSData object. Requesting [data description] where 'data' is the encrypted string data gives an NSString like: "<0b368353 a707e7de 3eee5992 ee69827e e3603dc2 b0dbbc0b...

How do you use the crypt library in C for DES encryption? (setkey, encrypt, crypt, etc.)

I need to do some simple DES encryption in C to interface with some old code. From what I understand you can use the "crypt" library for this, with the functions setkey, encrypt, crypt, etc. I have been messing with it and can't get it right. The example on the man page for setkey/encrypt is lacking. I want to get the same output as I w...

Hide autoincrement ids in GET parameter (PHP)

Hello! Problem: I have dynamic pages in PHP where the content is shown according to the given id. The id is always submitted via a GET parameter: page.php?id=X This causes a problem: Site visitors can enumerate the ids and simply walk through all the different content pages. This shouldn't be possible, of course. How could this be sol...

FTP Handler in IIS to modify incoming requests

We need to setup an FTPS server using IIS to allow a client to pull files down from us. Our data center requires that all files be encrypted on disk and decrypted on the fly by our server before returning the file to the client. We've done similar things in the past for HTTPS by creating an HTTP Handler and doing the decryption in a cust...

How to decrypt encrypted Oracle data that was replicated to SQL Server 2008?

I have a case where Oracle data (phone numbers) was encrypted using the Oracle DBMS_OBFUSCATION_TOOLKIT DESEncrypt function with a unique user generated hash key. SQL Example: update Phone set encrypted_phone = WEBX_ENCRYPT_DECRYPT.ENCRYPT( '212-555-1201', '8IcrEuOdDjRT5iDjqHLcsA==') where person_id = 120000...

Can a protocol be secured by encryption?

This is something I've always wanted to learn. When I design a system (software or hardware) where multiple components communicate with each other, how can I implement some simple encryption or other features in the protocol for some basic security? I can change the protocol anyhow, since I have low-level access down to the series of by...

How to implement Java 256-bit AES encryption with CBC

Hi, I've read the following threads and they've helped a little, but I'm looking for a little more info. How to write AES/CBC/PKCS5Padding encryption and decryption with Initialization Vector Parameter for BlackBerry Java 256bit AES Encryption Basically, what I am doing is writing a program that will encrypt a request to be sent over...

SQLServer Encryption Of Data Channel From C#

Can anyone give me pointers on how to achieve the above - I am familiar with the C# libraries and database connectivity but have never had to use a secure channel. What do I need to do in C# and on the database side to force connections to always be encrypted?? ...

Why do I get different outputs when encrypting using DPAPI?

...

SevenZip, many trailing 0s

My array is 140bytes. outArray is 512bytes... Not what i wanted. Also i dont know if i am encrypting properly. Is the code below correct? how do i fix this so outArray is the real size and not fixed with many trailing zeros? var compress = new SevenZipCompressor(); compress.CompressionLevel = CompressionLevel.Ultra; ...

AES Encryption in .net

How can I use AES in C# .NET to encrypt a file and then securely remove the local copy of the file? Can someone please point me to a good example on how to do this. Is AES the strongest encryption available in .NET 3.5? ...

SQL 2005 MD5 Hash and C# MD5 Hash

I currently have a legacy database (SQL 2005) that generates hash strings for tokens. It does it like this... DECLARE @RowID INT DECLARE @hashString VARCHAR(128) SET @RowID = 12345 SET @salt= 0xD2779428A5328AF9 SET @hashBinary = HASHBYTES(('MD5', @salt + CAST(@RowID AS VARBINARY(30))) SET @hashString = sys.fn_varbintohexstr(@hashBina...

How secure is this architecture?

Hi, I'm building a system that need to collect some user sensitive data via secured web connection, store it securely on the server for later automated decryption and reuse. System should also allow user to view some part of the secured data (e.g., *****ze) and/or change it completely via web. System should provide reasonable level of s...

How can I extract the title from an encrypted PDF in PHP?

How can I extract the title from an encrypted (write protected, not password protected) PDF file using PHP on Linux? Usage of external libraries or binaries are OK. Zen_PDF did not work (Exception: Encrypted document modification is not supported) nor did libextract (title="filename of pdf.pdf") ...

Phone-To-Server communication encryption in Java

Hi, This goes along with another thread, here: How to implement Java 256-bit AES encryption with CBC Mainly, trying to get AES encryption on a phone using Java. My question here is how to handle the encryption key. I don't know if I should store the key, hash the key and use that, or do a public-key-encyption scheme. I would rather ha...

How to encrypt using public key?

msg = "this is msg to encrypt" pub_key = M2Crypto.RSA.load_pub_key('mykey.py') // This method is taking PEM file. encrypted = pub_key.public_encrypt(msg, M2Crypto.RSA.pkcs1_padding) Now I am trying to give file containing radix64 format public key as a parameter in this method and unable to get expected result i.e encryption using ra...

RijndaelManaged Key generation

I need to encrypt data and store it in a file and later be able to decrypt it back. For this I am using RijndaelManaged class. Now I do not want to keep the key hardcoded in the code. After some googling I found this method - Here the key is generated but then all other values like passphrase, salt and IV are hardcoded. I do not have th...

Standards for Encrypting data in SOX/HIPAA in SQL Server 200x

I was wondering if there are any standards for encrypting sensitive data in Database which are compliant w/ SOX or HIPAA. Or does the Encrypt Function in SQLServer necessary?. or handle in Business logic. Any ideas or links we have. ...

Random access encryption with AES In Counter mode using Fortuna PRNG:

I'm building file-encryption based on AES that have to be able to work in random-access mode (accesing any part of the file). AES in Counter for example can be used, but it is well known that we need an unique sequence never used twice. Is it ok to use a simplified Fortuna PRNG in this case (encrypting a counter with a randomly chosen u...