{"action":"created","issue":{"url":"https://api.github.com/repos/solidblu1992/ethereum/issues/5","repository_url":"https://api.github.com/repos/solidblu1992/ethereum","labels_url":"https://api.github.com/repos/solidblu1992/ethereum/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/solidblu1992/ethereum/issues/5/comments","events_url":"https://api.github.com/repos/solidblu1992/ethereum/issues/5/events","html_url":"https://github.com/solidblu1992/ethereum/issues/5","id":320719194,"number":5,"title":"ECDHE and AES","user":{"login":"darioAnongba","id":11042697,"avatar_url":"https://avatars0.githubusercontent.com/u/11042697?v=4","gravatar_id":"","url":"https://api.github.com/users/darioAnongba","html_url":"https://github.com/darioAnongba","followers_url":"https://api.github.com/users/darioAnongba/followers","following_url":"https://api.github.com/users/darioAnongba/following{/other_user}","gists_url":"https://api.github.com/users/darioAnongba/gists{/gist_id}","starred_url":"https://api.github.com/users/darioAnongba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darioAnongba/subscriptions","organizations_url":"https://api.github.com/users/darioAnongba/orgs","repos_url":"https://api.github.com/users/darioAnongba/repos","events_url":"https://api.github.com/users/darioAnongba/events{/privacy}","received_events_url":"https://api.github.com/users/darioAnongba/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-07T08:32:09Z","updated_at":"2018-05-07T17:59:40Z","closed_at":null,"author_association":"NONE","body":"Hi, \r\n\r\nSorry to bother you again. Sadly I am not able to fully understand how do you plan on adding the blinding factor and the value on-chain as part of a transaction just by reading your code.\r\n\r\nIf I understand correctly, you are encrypting the bf and the value into a message using AES and then you embed those values into an event along with the IV, so you have something like that.\r\n\r\n```TxEvent(...other_values, message = encrypted(value, bf), iv)```\r\n\r\nIn order to decrypt the message the parties need a shared key that is generated and communicated off-chain using ECDHE. Now the problem is, what is one of the parties lose the shared key, or if they reinstall the app at some point and need to resync? How can I recover the values? I'm missing something I think.\r\n\r\nThanks again for your time,\r\nDario"},"comment":{"url":"https://api.github.com/repos/solidblu1992/ethereum/issues/comments/387149965","html_url":"https://github.com/solidblu1992/ethereum/issues/5#issuecomment-387149965","issue_url":"https://api.github.com/repos/solidblu1992/ethereum/issues/5","id":387149965,"user":{"login":"solidblu1992","id":565175,"avatar_url":"https://avatars1.githubusercontent.com/u/565175?v=4","gravatar_id":"","url":"https://api.github.com/users/solidblu1992","html_url":"https://github.com/solidblu1992","followers_url":"https://api.github.com/users/solidblu1992/followers","following_url":"https://api.github.com/users/solidblu1992/following{/other_user}","gists_url":"https://api.github.com/users/solidblu1992/gists{/gist_id}","starred_url":"https://api.github.com/users/solidblu1992/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidblu1992/subscriptions","organizations_url":"https://api.github.com/users/solidblu1992/orgs","repos_url":"https://api.github.com/users/solidblu1992/repos","events_url":"https://api.github.com/users/solidblu1992/events{/privacy}","received_events_url":"https://api.github.com/users/solidblu1992/received_events","type":"User","site_admin":false},"created_at":"2018-05-07T17:59:39Z","updated_at":"2018-05-07T17:59:39Z","author_association":"OWNER","body":"> With your solution we have R = rG, ss = rP == Rp. Is that what you implemented in your RingCTToken.sol ?\r\n\r\nIt's close.  So in RingCT, the receiver has two key pairs: spend (S=sG1) and view (V=vG1).  I use two shared secrets in RingCT, one for picking the stealth address and one for the AES key.  Both are generated from the same DHE point (R=rG).\r\n\r\n```\r\nss_aes = keccak256(rS) = keccak256(sR)\r\n\r\nss_stealth = keccak256(rV) = keccak256(vR)\r\nDestPubKey = (ss_stealth)(G1) + S\r\nDestPrivKey = (ss_stealth + s) mod Ncurve\r\n```\r\nFeel free to ignore ss_stealth as you won't need it, but I included it for clarity and for fun :-)\r\n\r\n> Also, a more technical question. I don't understand why you define encrypted_data as an array of size 3. Is the third element the IV ? If so, is it necessary to encrypt it ?\r\n\r\nThe IV is the initialization vector for the particular form of AES that I'm using.  It's just a random bit string.\r\n\r\n> Is that the function you use to generate the encrypted_data array ?\r\n\r\nActually, I don't think I ever use to_scalars().  I created that function in order to experiment embedding the encrypted data into the pedersen commitment range proof.  But, I never actually used it anywhere.  Converting the AES data into uint256's is much more straight forward:\r\n```\r\nencrypted_data[0] = message[:32]\r\nencrypted_data[1] = message[32:]\r\nencrypted_data[2] = iv\r\n```\r\nI do this in RingCT.Print_MEW(), for example."}}
{"actor":{"display_login":"solidblu1992"}}