Comments (12)
I hit this. My real https lock (with certs) is fine so luckily this is not impacting me :-)
For a test shell script with cert (that doesn't really control a lock https://github.com/mwarning/trigger/pull/30/files) I get an error that its too big (larger than 5000 bytes).
from trigger.
I tried to apply compression, but the result was not significant enough to be useful.
from trigger.
I was able to fit some certificates (e.g. for google.com) in the QR-Code. No idea how to improve the situation in general.
from trigger.
I was not able to scan the qrcode with a generic app to look at the payload (scanning from within Trigger works great).
I spent a little time looking at the json export files. I saw a few places in the json payload where there is room for saving some bytes, I do not know if this would apply to qrcode:
- the json file always contains a dictionary key, even for empty contents. Omitting empty string/null values would save a few bytes
- the ssh key is noticeably larger (for me double the size) compared with a https key/
- the ssh key is base encoded multiple times, there is the original plain-text (I think PEM PKCS8) format, this contains plain text markers along with base64 encoded data. Then as a wrapper there appears to be some binary data concatenated with the key, this combined payload is then base64 encoded again. This double encoding does pad out the payload more than needed, however the key is still larger than my sample https cert even if you ignore the double encoding.
Again, I looking at json payload. I'm not sure what the qrcode payload is where space is constrained.
from trigger.
hm, empty strings and null values should be removed from the QR-Code: https://github.com/mwarning/trigger/blob/v1.9.1/app/src/main/java/com/example/trigger/QRShowActivity.java#L78
from trigger.
This encoding for the ssh key could be improved. For now I wanted to be sure to get a string that does not contain binary data or the " character.
from trigger.
The ssh key is also big because it stores the private and public key. Only the private key should be ok, but I do not know yet how to restore the public key from the private one with the library at hand.
from trigger.
For reference: https://stackoverflow.com/questions/57058149/jsch-create-public-key-from-private-key
from trigger.
The QR-Code is ~3400 Bytes now. But that is still too big.
from trigger.
@mwarning good improvement/progress, frustrating results!
I don't need this functionality, json export/import is good for me. But this is an interesting problem. I have an idea for #32, I'll update there.
from trigger.
The private key is about 512 Bytes (4096 bits), so it should be possible to fit it into the QR code - in theory.
from trigger.
The used library stores the public key along the private key. There is not much i can do right now. Compression won't help here in a significant way. Closing this for now.
from trigger.
Related Issues (20)
- Reply pattern is not available when MQTT is chosen HOT 3
- SSH authentication with pubkey and password HOT 6
- Status not read on state change HOT 15
- Automatically query status after changing status/polling/overview HOT 1
- SSH seems to be broken HOT 4
- backup import problems from cloud storage HOT 13
- HTTPS peer authentication issue. HOT 3
- No documentation on JSON format. HOT 3
- Mastodon account for this project HOT 1
- Nuki not working HOT 30
- Release for 3.3.5 with latest fixes (Basic Auth) HOT 2
- Basic auth throwing illegal argument exception HOT 1
- HTTPS Client Certificates for authentication HOT 5
- Feature Request: MQTT with client certificate HOT 15
- warning/trigger HOT 1
- Wishlist: Geofence HOT 12
- callback compatibility issue when initialing method HOT 2
- status URL doesnt help (probably as method is different?) HOT 4
- Documentation: SSH Key Registration does not seem to work (or I missunderstood what to do) HOT 3
- ssh: private ED25519 key export / import does not work HOT 3
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 trigger.