Comments (1)
I don't know it you are still needing a fix after all that time but here it is.
C# implementation does not work for non English cahracters.
After little bit of testing I have found the problem.
Code uses length of the string to encrypt data lenghth of the sting is expressed in characters which is not same as the array size generated by GetBytes method (it is the same using ASCII character only).
replace if statements in method EncryptDecrypt
....
if (mode.Equals(EncryptMode.Encrypt))
{
var encbytes = _enc.GetBytes(inputText);
//encrypt
byte[] plainText = _rcipher.CreateEncryptor().TransformFinalBlock(_enc.GetBytes(inputText), 0, encbytes.Length);
_out = Convert.ToBase64String(plainText);
}
if (mode.Equals(EncryptMode.Decrypt))
{
//decrypt
var decText = Convert.FromBase64String(inputText);
byte[] plainText = _rcipher.CreateDecryptor().TransformFinalBlock(decText, 0, decText.Length);
_out = _enc.GetString(plainText);
}
...
from cross-platform-aes-encryption.
Related Issues (20)
- Encrypt in java and Decrypt in IOS - Not working HOT 1
- Decryption result getting null in IOS
- Encryption in c# is broken if string to encode contains non English characters (with fix)
- iOS Swift Problem HOT 2
- encryption and decryption error when I encrypt a long string with C#
- Not working in IOS. Please check before using. HOT 2
- How to implement encryption and decryption in PHP? HOT 1
- Encrypted string in C# and Decryption IOS vise versa not working
- Facing problem while decryption in iphone5
- Cancelled issue reporter's mistake
- string decryption failed in c# which encrypted in objective c
- Android encryption and decryption facing issue
- The key is not correctly converted to hex string in iOS 13 beta
- Add authentication
- How can i use it in Swift 5 or 4 HOT 1
- .Net Support
- Unable to decrypt my encrypted data. HOT 2
- Refactor - c#, android and web
- Request for a feature in Golang
- Cut big Sentence after Decrypt
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cross-platform-aes-encryption.