aes

Objective-C library recommendation for AES-256 in CTR mode

Hello, I'm looking for recommendations on an Objective-C library for AES-256 encryption in CTR mode. I have a database full of data encrypted with another library using CTR and seems the included CCCrypt only supports ECB or CBC with PKCS#7. Any idea on the best portable library I should use? I'm not looking to port the original implem...

My AES encryption/decryption functions don't work with random ivecs

I was bored and wrote a wrapper around openSSL to do AES encryption with less work. If I do it like this: http://pastebin.com/V1eqz4jp (ivec = 0) Everything works fine, but the default ivec is all 0's, which has some security problems. Since I'm passing the data back as a string anyway, I figured, why not generate a random ivec and stick...

AES/Rijndael implementation for SQL Server 2000?

Do you know any function implementation I could use for decrypting data encrypted by AES/Rijndael in SQL Server 2000? ...

AES encrypted value, the conversion happens NSString value to NSData?

cipher.h cipher.m are developing a module has. NSData value of the encrypted value problem as follows. : <0b21kck 0v35919 sk2910> As the purpose of encryption is to be sent to NSURLConnection String value. NSString value to NSData encrypted so I think it must be converted to What can you do? ...

AES buffer size

I'm trying to adapt this DES encrypting example to AES, so I made the changes, and it try to run this: import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.io.OutputStream; import java.security.spec.AlgorithmParameterSpec; import javax.crypto.Cipher; import javax.crypto.CipherInputStream; import ...

AES code throwing NoSuchPaddingException: Padding NoPaddin unknown

The following code is a try to encrypt data using AES with asymmetric key: import java.io.OutputStream; import java.math.BigInteger; import java.security.Key; import java.security.KeyFactory; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; import java.security.spec.RSAPrivateKeySpec; import j...

NSData to NSString by changing the value null is returned. I need you help

*cipher.h, cipher.m all code : http://watchitlater.com/blog/2010/02/java-and-iphone-aes-interoperability Cipher.m -(NSData *)encrypt:(NSData *)plainText{ return [self transform:KCCEncrypt data:plainText; } step1. Cipher *cipher = [[Cipher alloc]initWithKey:@"1234567890"]; NSData *input = [@"kevin" dataUsingEncoding:NSUTF8StringEnc...

AES Encryption Java Invalid Key length

I am trying to create an AES encryption method, but for some reason I keep getting a 'java.security.InvalidKeyException: Key length not 128/192/256 bits'. Here is the code: public static SecretKey getSecretKey(char[] password, byte[] salt) throws NoSuchAlgorithmException, InvalidKeySpecException{ SecretKeyFactory factory = SecretKe...

AES key size in Java

Testing RSA to encrypt an AES key, I realized that RSA has only 1 block with a limited size (settable by the programmer) do store the encrypted key. The question is, when I use: KeyGenerator.getInstance("AES").generateKey() the AES keys will have a constant size in every computer and jvm implementation? ...

openssl hmac using aes-256-cbc

Hello, I am trying to take an AES HMAC of a file using the openssl command line program on Linux. I have been looking at the man pages but can't quite figure out how successfully make a HMAC. I can encrypt a file using the enc command with openssl however I can't seem to create a HMAC. The encryption looks like the following: opens...

Encrypting with AES

Why can I encrypt only 16 characters of text? Works: string plainText = "1234567890123456"; Doesn't work: string plainText = "12345678901234561"; Doesn't work: string plainText = "123456789012345"; Code: string plainText = "1234567890123456"; byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); byte[] keyBytes = Syste...

what is wrong in java AES decrypt function?

hi, i modified the code available on http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html and made encrypt and decrypt methods in program. but i am getting BadpaddingException.. also the function is returning null.. why it is happing?? whats going wrong? please help me.. these are variables i am using: kgen = Ke...

How to encrypt/decrypt multiple strings in AES encryption??

hello again everyone, i would like to know if i could encrypt two or more strings in AES encryption. let say, i want to encrypt username, password and nonce_value, can i use the following code? try{ String codeWord = username, password, nonceInString; String encryptedData = aseEncryptDecrypt.encrypt(codeWord); String decryptedData =...

Help for AES-128 Bit Algorithm ?? i want to encrypt it

Can i get link for AES-128 Bit Algorithm any sample code please help ...

.NET AES returns wrong Test Vectors

I need to implement some crypto protocol on C# and want to say that this is my first project in C#. After spending some time to get used on C# I found out that I am unable to get compliant AES vectors. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; using System.I...

What's the default size of AES generated keys?

In the code javax.crypto.KeyGenerator.getInstance("AES").generateKey(); What's the size of the generated key? ...

iPhone: Encrypt Nsstring using AES 128 and Decrypt

Hi all, I am new to Encryption/ Decryption. I want to encrypt a NSString variable value using key. Also I want to decrypt the encrypted data . I want to apply AES -128 Algorithm. Please suggest sample code or useful link. ...

How to get compatibility between C# and SQL2k8 AES Encryption?

I have an AES encryption being made on two columns: one of these columns is stored at a SQL Server 2000 database; the other is stored at a SQL Server 2008 database. As the first column's database (2000) doesn't have native functionality for encryption / decryption, we've decided to do the cryptography logic at application level, with .N...

Encrypting Files with AES, Encrypting Key with RSA - Am I on the right track?

Overview: I'm trying to design an application that will encrypt files to safely send through Snail Mail (LARGE sets of data). I'm planning on using AES/RijndaelManaged encryption from .Net to encrypt the files initially, using a randomly generated key using RNGCryptoServiceProvider. I'm then encrypting this random AES key with a RSA Pu...

Password Cracking in 2010 and Beyond

I have looked a bit into cryptography and related matters during the last couple of days and am pretty confused by now. I have a question about password strength and am hoping that someone can clear up my confusion by sharing how they think through the following questions. I am becoming obsessed about these things, but need to spend my t...