Comments (5)
Cryptico can't encrypt many Unicode characters. If you want to encrypt foreign characters, emojis, etc. You should first encodeURI(Turkish text)
, encrypt the encoded text, decrypt, and decodeURI(encoded plaintext)
. Example:
let turkishText = "Ölçek";
turkishText = encodeURI(turkishText); // Becomes "%C3%96l%C3%A7ek"
let cipher = cryptico.encrypt(turkishText, publicKeyHere).cipher;
let plaintext = cryptico.decrypt(cipher, privateKeyHere).plaintext;
decodeURI(plaintext); // Becomes Ölçek
This can be used to encrypt any Unicode text. @wwwtyro I think it would be helpful if Cryptico automatically encoded and decoded Unicode text.
from cryptico.
The encodeURI() function encodes special characters, except: , / ? : @ & = + $ #
So, not work your solution.
let turkish = "Türkçe karakterleri şifreliyor artık!";
result decrypt decodeURl(turkish) -> T%C3%BCrk%C3%A7e%20karakterleri%20%C5%9Fifreliyor%20art%C4%B1k!
from cryptico.
I think you have misunderstood the response, you can encode any Unicode string with encodeURI. I have used Cryptico with encode/decodeURI in production, and it works perfectly fine. Cryptico does not have trouble encrypting / ? : @ & = + $ #
so it does not matter if encodeURI does nothing to those characters. Something must have gone wrong in your implementation, as it works fine for me:
from cryptico.
from cryptico.
Request to close this issue
from cryptico.
Related Issues (20)
- How can I get the private key from the generated RSA key object? HOT 1
- Can cryptico use WebCrypto to accelerate the generation of RSA key pairs?
- RSA OAEP padding
- Cryptico for hybrid mobile apps
- is generateRSAKey() deterministic? HOT 4
- store javascript object rsa private key HOT 2
- cryptico for native ios application
- Add toJSON and fromJSON methods
- Uncaught TypeError: Cannot read property 'toString' of undefined HOT 3
- bnpFromNumber logical bug
- [feature suggestion] PEM support HOT 2
- Decrypt on Server Side HOT 1
- Getting error "Message too long for RSA (n=32, l=32)" HOT 1
- Can't encrypt text
- In jsbn, what is the correct function of variable DV?
- sign without encrypt?
- UTF-8 Support HOT 1
- Install cryptico HOT 1
- a bug in library
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 cryptico.