eclair4151 / smartcrypto Goto Github PK
View Code? Open in Web Editor NEWThis project forked from sectroyer/smartcrypto
SmartView2 Handshake API implementation
This project forked from sectroyer/smartcrypto
SmartView2 Handshake API implementation
@eclair4151 @McKael @sectroyer
This is not an issue but a question. I'm porting this code to vb.net for my HA application. So far all code works and is checked against the PY implementation but I can't figure out this code
def applySamyGOKeyTransform(input):
r = Rijndael(bytes.fromhex(keys.transKey))
return r.encrypt(input)
.net has AES and Rijdael but they return different results from what the PY code returns. All AES and SHA1 code in this PY project I figured out how to use with .NET but the above I can't figure out. Rijndael is supposed to be AES but you guys picked specifically an flavor of RIjndael. Any idea why? Any idea how this is different from AES? Specific setting?
I'm executing smartcrypto.py
with sudo ./smartcrypto.py
and I'm getting the following errors
from: can't read /var/mail/__future__
from: can't read /var/mail/PySmartCrypto
./smartcrypto.py: 3: ./smartcrypto.py: import: not found
./smartcrypto.py: 4: ./smartcrypto.py: import: not found
from: can't read /var/mail/PySmartCrypto.command_encryption
./smartcrypto.py: 6: ./smartcrypto.py: import: not found
./smartcrypto.py: 7: ./smartcrypto.py: import: not found
./smartcrypto.py: 8: ./smartcrypto.py: import: not found
./smartcrypto.py: 12: ./smartcrypto.py: UserId: not found
./smartcrypto.py: 13: ./smartcrypto.py: AppId: not found
./smartcrypto.py: 14: ./smartcrypto.py: deviceId: not found
./smartcrypto.py: 15: ./smartcrypto.py: tvIP: not found
./smartcrypto.py: 16: ./smartcrypto.py: tvPort: not found
./smartcrypto.py: 18: ./smartcrypto.py: lastRequestId: not found
./smartcrypto.py: 19: ./smartcrypto.py: Syntax error: "(" unexpected
I have run the script and pin is accepted. But now how do I find my token? What line is it in?
The connection to the TV worked without any issue but when trying to send a key to the TV nothing happens.
Via:
connection.recv()
print(connection.connected)
I can see that the script connected to the TV but nothing will happen, no matter what button I try to send.
Is there a solution to this problem?
Hey @eclair4151,
Your code works great with my UE55HU7505 (2014?) TV. But i can't turn the TV ON with this code. Should this SmartCrypto also support that feature?
Traceback (most recent call last):
File "smartcrypto.py", line 126, in
output = HelloExchange(tvPIN)
File "smartcrypto.py", line 68, in HelloExchange
return crypto.parseClientHello(clientHello, hello_output['hash'], hello_output['AES_key'], UserId)
File "/home/lebhack/SmartCrypto-master/PySmartCrypto/crypto.py", line 79, in parseClientHello
secret = bytes.fromhex(hex(pow(bnPGx, bnPrivateKey, bnPrime)).rstrip("L").lstrip("0x"))
ValueError: non-hexadecimal number found in fromhex() arg at position 255
i got:
pEncWBGx: "redacted"
pEncGx: "redacted"
pGx: "redacted"
cant get the CTX code
Is there any way to proceed from this point?
HI @eclair4151,
I have an issue with my tv (J5500), I am able to get the token and Id session, and the work, I can send commands to the TV, but when I turn off and then ON the TV, I need to re-pair the TV again because TV seems not to receive any command.
Hi,
I ' ve tried to send command on a model J and the Tv seems not understanding the command.
The handshake part of the communication process works fine.
Have you managed to send successfully a command andon which Tv model.
Thanks !
Goal
I would like to install this on a Raspbian. Goal is to use it with node-red and over SSH.
Problem:
Hi,
can I please get help while executing:
python3 PySmartCrypto/smartcrypto.py Traceback (most recent call last): File "PySmartCrypto/smartcrypto.py", line 2, in <module> import crypto File "/root/temp/SmartCrypto-master/temp/SmartCrypto/PySmartCrypto/crypto.py", line 2, in <module> from Crypto.Cipher import AES ImportError: No module named 'Crypto'
Any ideas how I can fix this?
I have a QN65Q6FNA.
I do not get a pin page on my display when I run the command "ws://10.0.0.243:8001/ws/app/CloudPINPage".
if I run this from the WS google extension I get:
{
"data": {
"clients": [
{
"attributes": {
"name": null
},
"connectTime": 1559090240610,
"deviceName": "Smart Device",
"id": "ac9d77c9-af62-4f6b-b366-14e6d58d99e5",
"isHost": false
}
],
"id": "ac9d77c9-af62-4f6b-b366-14e6d58d99e5"
},
"event": "ms.channel.connect"
}
I have tried so many different Samsung control python scripts and cannot get anything to work.
Any help would be great.
Hi,
after I run
python smartcrypto.py
I got the same issue after I input then PIN back
Current state: stopped
Pin NOT on TV
Please enter pin from tv: 9220
Got pin: '9220'
AES key: d46ecd26a032ded4a2f9f4e8b7ef41f1
Traceback (most recent call last):
File "smartcrypto.py", line 126, in <module>
output = HelloExchange(tvPIN)
File "smartcrypto.py", line 55, in HelloExchange
hello_output = crypto.generateServerHello(UserId,pin)
File "/srv/homeassistant/lib/python3.5/site-packages/PySmartCrypto/crypto.py", line 39, in generateServerHello
cipher = AES.new(aes_key, AES.MODE_CBC, iv)
File "/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/AES.py", line 206, in new
return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/__init__.py", line 79, in _create_cipher
return modes[mode](factory, **kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/_mode_cbc.py", line 253, in _create_cbc_cipher
return CbcMode(cipher_state, iv)
File "/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/_mode_cbc.py", line 96, in __init__
c_uint8_ptr(iv),
File "/srv/homeassistant/lib/python3.5/site-packages/Crypto/Util/_raw_api.py", line 109, in c_uint8_ptr
raise TypeError("Object type %s cannot be passed to C code" % type(data))
TypeError: Object type <class 'str'> cannot be passed to C code
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.