encryption

RSA example that do not use NoPadding

Where can I find a RSA encrypt example that does not use "NoPadding"? --update Better: how to make this SSCCE run correctly without throw the "too much data for RSA block" exception? import java.math.BigInteger; import java.security.KeyFactory; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey...

Which's the best way to protect primary key on ASP.NET MVC?

I'm creating a ASP.NET MVC website and I was wandering which techniques do you guys use to protect primary key on these mvc urls. Actually ASP.NET MVC generates this syntax for its urls: /Controller/Action/Id Last week I was trying to encrypt it using SHA-1 Encryption, but this encrypter generates some special symbols like + (plus), ...

how to add bouncycastle algorithm to android

Hi friends, I am trying to write a small application using bouncycastle algorithm, from the http://tinyurl.com/ylclavn (BouncyCastleProvider.java) it says we have to import and add the provider during runtime by the following code import org.bouncycastle.jce.provider.BouncyCastleProvider; Security.addProvider(new BouncyCastleProvider(...

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? ...

If attacker has original data and encrypted data, can they determine the passphrase?

If an attacker has several distinct items (for example: e-mail addresses) and knows the encrypted value of each item, can the attacker more easily determine the secret passphrase used to encrypt those items? Meaning, can they determine the passphrase without resorting to brute force? This question may sound strange, so let me provide a ...

Java: Get Key from encoded key

How to get back from encoded byte[] to java.security.Key? import java.security.Key; import javax.crypto.SecretKey; import javax.crypto.KeyGenerator; public class TestRSA { public static void main(String[] args) throws Exception { KeyGenerator kgen = KeyGenerator.getInstance("AES"); kgen.init(128); SecretKey key = kgen...

Python TEA implementation

Anybody knows proper python implementation of TEA (Tiny Encryption Algorithm)? I tried the one I've found here: http://sysadminco.com/code/python-tea/ - but it does not seem to work properly. It returns different results than other implementations in C or Java. I guess it's caused by completely different data types in python (or no data...

Encrypt the file for security

Actually I have a file . I am working in linux environment. I need to encrypt that file for secure purpose with giving the some password. The operation could be like zip , tar any compression. When I extract the file It should ask me password , only then it should get extracted Thanks in Advance ...

What's the difference between the 'DES' class and The 'DESCryptoServiceProvider' class?

All I can make out is that one of them is the BC for all 'DES' algorithms to be derived from and the later is a wrapper for the Cryptographic service provider implementation of the DES algorithm. The reason why I ask is that I am going over .Net Security and the MS official training book simply refers to the DES class but the another of...

Retrieving Encrypted Rich Text file and showing it in a RichTextBox

OK, my need here is to save whatever typed in the rich text box to a file, encrypted, and also retrieve the text from the file again and show it back on the rich textbox. Here is my save code. private void cmdSave_Click(object sender, EventArgs e) { FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write); ...

Handling User Authentication in .NET?

I am new to .NET, and don't have much experience in programming. What is the standard way of handling user authentication in .NET in the following situation? In Process A, User inputs ID/Password Process A sends the ID/Password to Process B over a nonsecure public channel. Process B authenticates the user with the recieved ID/Password ...

Need suggestions for a good way to encrypt/decrypt data stored in SQLite database on Android.

Title says it all. I have some sensitive data that is stored in SQLite for an Android app. I need to be able to encrypt when persisting but then also decrypting when deserializing from the database too. Not sure what my options are on Android for doing this? ...

PGP Encryption/Decryption in Adobe Flash

Is it possible to make PGP encryption/decription in Adobe Flash Application? ...

Securing Coredata objects

I am working on an application which has got some sensitive information. I am aware that it would be difficult for a layman to hack into iphone to get the information. If I use SQLite directly I have something called SQLite Cipher to encrypt / encode the database. Is there anyway where I can have the same way of encrypting the coredat...

How to pass variable value to gpg commands

$importkey = system('gpg --import newkey.asc . $username'); need to pass the file name as a variable.so that file name with its contents can be import in gnupg keyring. $gpg = system('gpg --recipient userid --output filename --armor --encrypt filename to encrypt', $retvalue); how can i pass the recipient email id(userid) and the f...

simple yet secure encrypt / decrypt asp to asp.net

First post here. I have a asp/vb6 web app that logs in a user I want to encrypt the users identity field and pass(querystring) it to a asp.net app and then decrypt it to do a db lookup. I've google'd it of course and found rot13, not secure enough. I've also found some hits on MD5 / RC4 but did not find any good examples of encrypt / ...

C# Wrapping an application within another application

I want to secure some applications for some people without teaching them how to add an encryption or authentication, so I thought about mocking up a simple application that launches another application if some password or authentication function returns true. How would I wrap the application so that only the launcher would be able to acc...

encrypting assets (video files) in Adobe AIR

Hi I am trying to create a video player in Adobe AIR. I want to encrypt the video files so that they are not sharable outside the player. I don't want to jump through hoops to create a rock-solid system but something simple that just prevents 90-95% of the users from sharing the content. I have been through a related question on SO at ...

Need MD5 guideline

Is there any specific algorithm for the encoding and decoding MD5. Kindly give me the proper direction or guideline, so that I can move on.. I have search a lot on Google but I haven't find, kindly give the articles or tutorial link. ...

How to match ColdFusion encryption with Java 1.4.2?

* sweet - thanks to Edward Smith for the CF Technote that indicated the key from ColdFusion was Base64 encoded. See generateKey() for the 'fix' My task is to use Java 1.4.2 to match the results a given ColdFusion code sample for encryption. Known/given values: A 24-byte key A 16-byte salt (IVorSalt) Encoding is Hex Encryption al...