mnault000 Posted October 30, 2013 Report Share Posted October 30, 2013 #!/usr/bin/python # SHA1 encoderimport hashlibimport osfrom base64 import b32encode secret_to_generate = raw_input('Please Enter the name to encode for the secret: ')hash_object = hashlib.sha1(secret_to_generate) hex_dig = hash_object.hexdigest()base32_dig = b32encode(hex_dig) print 'This is the HEX Digest: ', hex_digprint 'This is your secret to share: ', base32_dig Note: I find this useful as I created many folders and only display the printed list on the web. From the folder name, I already know a key, so I just create the new secret remotely, assign it to my folder, and I can download whatever I need from home. Quote Link to comment Share on other sites More sharing options...
humfri Posted November 5, 2013 Report Share Posted November 5, 2013 Could you explain a bit more what that means exactly? Is a working secret creatable just by knowing the folder name or do you use a "key" which creates a working secret? Quote Link to comment Share on other sites More sharing options...
mnault000 Posted November 5, 2013 Author Report Share Posted November 5, 2013 Hi, sorry I was a bit vague.Here's what I mean. At home, I can host with bit torrent sync through my LAN a folder in which I can put stuff I will eventually need to download from somewhere around the world. A big advantage: the web server displaying the folder link does not host the actual data. So here goes... I need to store a WinXP ISO with all related gizmos in a folder. I create the folder like WinXP_BTSync_what_is the_name_of_my_dog. Once my folder is created with that name, I go to BTSync, assign that folder to sync, but instead of using the "generate secret", I use my own script in my first post, with the key --> WinXP_BTSync_RexSo.. I'm in Europe, need to get the WinXP ISO.. I first install Bit torrent sync, then I browse my website to see which folder I need to sync (site only shows the folder name and content names). I will generate the secret from my dog's name (REX), and then the folder will sync. I'm working on having the ability to generate that secret directly from my website. Quote Link to comment Share on other sites More sharing options...
mnault000 Posted November 5, 2013 Author Report Share Posted November 5, 2013 So In essence.. The folder name "contains clues to generate the secret in order to connect, sync and create a wormhole to your data". Quote Link to comment Share on other sites More sharing options...
mnault000 Posted November 29, 2013 Author Report Share Posted November 29, 2013 This is what I Mean.. I created a folder named "demo_MY_DOG_NAME" for which I obviously know my dog's name.So I'm somewhere on a computer and I need something at home in the above folder. Go to my website (url below), and insert the string "demo_REX" (no quotes!!), and copy-paste the resulting secret into your bittorrent application for the folder you will sync with.I like this approach for these reasons:1) the data is not on the server hosting that url2) I can prepare a multitude of directories with different password, and get anything encrypted. (try my demo here --> http://redirect.imperialauriga.com:8011/base_btsync_portal/index.php ) For this demo, you will sync with a simple text file (.txt) I made for this proof-of-concept. Quote Link to comment Share on other sites More sharing options...
rdebath Posted December 22, 2013 Report Share Posted December 22, 2013 hex_dig = hash_object.hexdigest()base32_dig = b32encode(hex_dig) You're converting the hex to base32 'incorrectly'. Simply if you're taking the bits from the hex and reencoding them as base32 it should be 4/5 the size of the hex. It looks like you're taking the hex as ASCII bytes and encoding that instead. 'Correctly' ..Start with the string "cats" The SHA1 in hex is "8ebf601f8b808c32b8d2fb570c2e0fbdbb388add"The SHA1 in base32 is "R27WAH4LQCGDFOGS7NLQYLQPXW5TRCW5" Put that into BTSync and get ... cats. NB: http://www.debath.co.uk/MakeAKey.htm ALL in javascript. Quote Link to comment Share on other sites More sharing options...
lolcat Posted December 28, 2013 Report Share Posted December 28, 2013 Do you know how to make encrypted read-only secrets? I would be very interessted in having a python script to do that. It opens up so many features, you can setup encrypted inboxes where people can upload files, insecure caches, and so on. Quote Link to comment Share on other sites More sharing options...
gregcaulder Posted April 2, 2014 Report Share Posted April 2, 2014 #!/usr/bin/python # SHA1 encoderimport hashlibimport osfrom base64 import b32encode secret_to_generate = raw_input('Please Enter the name to encode for the secret: ')hash_object = hashlib.sha1(secret_to_generate) hex_dig = hash_object.hexdigest()base32_dig = b32encode(hex_dig) print 'This is the HEX Digest: ', hex_digprint 'This is your secret to share: ', base32_dig Note: I find this useful as I created many folders and only display the printed list on the web. From the folder name, I already know a key, so I just create the new secret remotely, assign it to my folder, and I can download whatever I need from home. Any possible way of getting this in the form of a PHP script.I tried wrapping my head around it, but i cant get RO keys to match from RW keys. Quote Link to comment Share on other sites More sharing options...
gregcaulder Posted May 7, 2014 Report Share Posted May 7, 2014 Anybody? Quote Link to comment Share on other sites More sharing options...
mikeyF Posted May 29, 2014 Report Share Posted May 29, 2014 I read that fast so i may have missed some info but there is a problem of security if you can generate a secret to access to a file just by knowing the name of the file. Quote Link to comment Share on other sites More sharing options...
mnault000 Posted June 4, 2014 Author Report Share Posted June 4, 2014 Hi.. I was away for a bit. What do you mean security issue? there are none if done right.if you create a folder, and insert in the name a clue as to what the key to encrypt that folder will be, then create the secret with that key. so in the future, just looking at the folder name will reveal that clue only to you.I've had this for months, working flawlessly. Quote Link to comment Share on other sites More sharing options...
fdsafdsafds@R Posted July 14, 2014 Report Share Posted July 14, 2014 This account has been removed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.