I am just reading about AES. I don't know much about it.
In many posts on forms I see people asking implementation of AES (slowAES) while using Java.
Is that necessary?
No.
AES is an algorithm; it is independent of the language in which it is implemented.
That being said, implementing a cryptographic algorithm properly is not an easy task, and you should use the built-in versions of the API's you're using when you need encryption.
No it's just a cryptographic algorithm. Can be implemented in most if not any language.
No.
Since you tagged your question as C#, I'll add that in .NET you have System.Security.Cryptography.AesManaged class, which implements the algorithm.
Since AES is an algorithm you can implement it in any language of your choice.The things which can make a difference is your understanding of the specification and the availability of tools in particular language which can make it easy for you to implement AES.
Related
I need a c# application use encryption algorithms to encrypt/decrypt strings
such as DES,SDES,RC5..
I don't need an implementation for them I just need to use them in c#
I'm new in this field and need help
thanx
Find the urls below for DSE,SDES,RC5:
http://www.codeproject.com/Articles/19538/Encrypt-Decrypt-String-using-DES-in-C
http://www.codeproject.com/Articles/91628/Simplified-version-of-the-DES-Data-Encryption-Stan
http://www.codeproject.com/Articles/22518/Encryption-with-RC-Algorithm
Try taking a look at the System.Security.Cryptography namespace on MSDN - cryptography tasks and here MSDN - cryptography namespace. These should get you started with encrypting and decrypting strings, not sure if it covers all the algo's you are after.
I'm using encrypt(string,key) and decrypt(string,key) for encryption in ColdFusion. Now what I would like to do is to encrypt in ColdFusion, but decrypt in asp.net C#. Can someone show me how to do this?
If this is my ColdFusion code:
encrypt("hello","abcdefgh")
decrypt(".....","abcdefgh"
What would the equivalent code in asp.net look like? Thank You.
According to Coldfusion's documentation,
The Standard Edition of ColdFusion installs a cryptography library with the following algorithms:
CFMX_COMPAT: the algorithm used in ColdFusion MX and prior releases. This algorithm is the least secure option (default).
Unless you implement the CF decryption algorithm in C#, you can't decrypt it. You would have to specify a different encryption algorithm, like 3DES, in order to decrypt it.
As Josh pointed out, if you do not specify an algorithm CF uses the default algorithm cfmx_compat. Unlike the standard algorithms such as AES, Blowfish, etcetera there is no library for it in .NET. To decrypt the value in C#, the .NET side would need to use a custom class. ( See here for my C# port of Railo's cfmx_compat class . )
That said, I would recommend against using cfmx_compat simply because it is a very weak algorithm. It is only included in CF for backward compatibility. You are much better off using one of the stronger algorithms like AES, Blowfish, etcetera in ColdFusion. Since those algorithms are standard, interoperability with C# (or any other language) will be much easier. See the links Al posted in the comments above for some examples.
I want to port this simple JAVA example...
AES Encryption/Decryption with Bouncycastle Example in J2ME
...to C# and have the two following 3 questions:
As I understand, the JAVA example uses AESEngine for encryption/decryption operations. What is the difference between AESEngine and AESFastEngine and AESLightEngine? Unfortunately I don't understand the information given in the documentation: http://www.bouncycastle.org/docs/docs1.6/index.html
I want to use a new encryption-key for every file I encrypt. Which block cipher modes of operation should I use: AES.CBC, AES.CFB, AES.ECB OR AES.OFB http://www.bouncycastle.org/docs/docs1.6/index.html
Is my assumption correct that in my case I don't have to use an iv / salt (which means I have to use a static iv?) since I use AES.KeyGen128() for key generation and use it only once?
http://www.bouncycastle.org/docs/docs1.6/index.html
Hope my questions do not cause too much confusion ;-) I but I appreciate every answer, clarification or feedback you can give me.
Mike
My reading of the doc says that the AESEngine, FastEngine and LightEngine all take different tradeoffs of memory versus speed. You would have to test it yourself to determine if those tradeoffs are even relevant in your scenario.
you will need to read up on the various AES modes. Different modes have different strengths and attributes, which may be more or less applicable or desirable depending on your scenario. So the answer to your question is "it depends."
no. you will need an IV. As far as the salt, it is usually employed with the passphrase to generate the actual encryption key and the IV, often via PKBDF2. That is outside the realm of AES, but it is a typical usage.
Finally you didn't ask, but.... why are you porting that code to C#? .NET has AES encryption built-in. You don't need to port anything, you can just use the .NET base class library. Just ensure you use the same keysize and mode, and make sure your key+iv is the same on each side, and the .NET BCL AES classes will interoperate with the BouncyCastle stuff for J2ME.
I need to encrypt bytecode to send over a connection to a webservice, preferably using a GUID as a key. I have done a bit of research and found several classes developed for a similar purpose, but haven't been able to turn up much that is built into the Windows libraries.
My question is: Is there something built in to C# that performs this task? If there is not, I would very much appreciate any suggestions as to implementation.
Edit: After reading this post When would I choose AesCryptoServiceProvider over AesManaged or RijndaelManaged?
I am going with AESCryptoServiceProvider.
You should check out the System.Security.Cryptography namespace.
It's not clear whether you're in a position to choose which algorithm etc to use, but you might consider one of the following symmetric algorithms:
AES: AesManaged or AesCryptoServiceProvider
Rijndael: RijndaelManaged
Triple DES: TripleDESCryptoServiceProvider
There are also implementations of DES and RC2, but I would probably ignore them unless you're forced to use them.
I want to work on the Rijndael algorithm using C#. Can anybody help me with this please?
I'm assuming you mean the Rijndael encryption algorithm - in which case RinjdaelManaged would be of use. The MSDN documentation (previous link) has examples, or there are lots of other references, for example see here.
I see (comments to other reply) that you are looking at implementing this yourself... some thoughts:
don't
why?
don't
Unless this is purely for interest, stick to the existing implementation. It will eat time, and potentially introduce security weaknesses. I can't think of a good reason to rewrite this.
sorry guys, but I just can not resist
from http://www.moserware.com/2009/09/stick-figure-guide-to-advanced.html
If you just need a working implementation check out the Rijndael Documentation on MSDN. The Rijndael implementation looks pretty convenient to interface with.
It's of course a different story if you are trying implement it yourself.
I am looking into the same that as per brian.
But the problem here is that all the rijndael samples available in the net are mostly using a Text File but is there any way of doing it in a Online Mode where when i get the data in the text box i convert it and put directly in to the database.
Any Hints on this would be much better and all the samples are defining the key from the Rijndael class itself, can't we provide the Key of our own.
cheers
Biju