Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# Fix Error in "Ñ or ñ" #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions C-Sharp/CryptLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace com.pakhee.common
*****************************************************************/
public class CryptLib
{
UTF8Encoding _enc;
UTF8Encoding _enc = new UTF8Encoding(true, true);
RijndaelManaged _rcipher;
byte[] _key, _pwd, _ivBytes, _iv;

Expand Down Expand Up @@ -117,13 +117,16 @@ private String encryptDecrypt (string _inputText, string _encryptionKey, Encrypt

if (_mode.Equals (EncryptMode.ENCRYPT)) {
//encrypt
byte[] plainText = _rcipher.CreateEncryptor().TransformFinalBlock(_enc.GetBytes(_inputText) , 0, _inputText.Length);

byte[] plainText = _rcipher.CreateEncryptor().TransformFinalBlock(_enc.GetBytes(_inputText), 0, _enc.GetBytes(_inputText).Length);
_out = Convert.ToBase64String(plainText);

}
if (_mode.Equals (EncryptMode.DECRYPT)) {
//decrypt
byte[] plainText = _rcipher.CreateDecryptor().TransformFinalBlock(Convert.FromBase64String(_inputText), 0, Convert.FromBase64String(_inputText).Length);
_out = _enc.GetString(plainText);

}
_rcipher.Dispose();
return _out;// return encrypted/decrypted string
Expand Down