Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'algorithm': 0.04; 'output': 0.05; 'matches': 0.07; 'subject:file': 0.07; 'work!': 0.07; 'directions': 0.09; 'key.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'weeks,': 0.09; 'xor': 0.09; 'stored': 0.12; 'random': 0.14; '(data': 0.16; '(same': 0.16; 'hashes': 0.16; 'key)': 0.16; 'keys.': 0.16; 'message-id:@4ax.com': 0.16; 'password,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:handling': 0.16; 'symmetric': 0.16; 'valid.': 0.16; 'variants': 0.16; 'trying': 0.19; '(but': 0.19; 'file,': 0.19; 'normally': 0.19; 'entered': 0.20; "aren't": 0.24; 'url:home': 0.24; 'sort': 0.25; 'possibly': 0.26; 'post': 0.26; 'header:X-Complaints-To:1': 0.27; '(this': 0.29; 'sep': 0.31; 'username': 0.31; 'anyone': 0.31; 'file': 0.32; 'supposed': 0.32; 'text': 0.33; 'open': 0.33; 'linux': 0.33; 'fri,': 0.33; 'moment': 0.34; 'skip:d 20': 0.34; 'could': 0.34; 'problem': 0.35; 'skip:- 50': 0.35; 'created': 0.35; 'late': 0.35; 'but': 0.35; 'there': 0.35; 'accessible': 0.36; 'passwords': 0.36; 'shorter': 0.36; 'vice': 0.36; "didn't": 0.36; 'charset:us-ascii': 0.36; 'level': 0.37; 'starting': 0.37; 'machines': 0.38; 'to:addr :python-list': 0.38; 'itself': 0.39; 'use.': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'system.': 0.39; 'received:org': 0.40; 'how': 0.40; 'read': 0.60; 'most': 0.60; 'tell': 0.60; 'break': 0.61; 'length': 0.61; 'new': 0.61; 'numbers': 0.61; 'simply': 0.61; 'information': 0.63; 'term': 0.63; 'such': 0.63; 'soon': 0.63; 'provide': 0.64; 'more': 0.64; 'account': 0.65; 'believe': 0.68; 'secure': 0.71; 'protect': 0.79; 'cracks': 0.84; 'desperately': 0.84; 'discovers': 0.84; 'done;': 0.84; 'leo': 0.84; 'of?': 0.84; 'secret,': 0.84; 'encrypted': 0.91; 'recover': 0.91; 'stretch': 0.91; 'received:108': 0.93; 'state.': 0.95; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: file handling issues Date: Sat, 07 Sep 2013 13:37:36 -0400 Organization: IISS Elusive Unicorn References: <43df7574-a7cd-45e2-a067-ae9c83c3a720@googlegroups.com> <41b6c459-ea3b-4714-9c52-fa916bd5c15c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-220-180.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 60 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378575466 news.xs4all.nl 15949 [2001:888:2000:d::a6]:57935 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53825 On Fri, 6 Sep 2013 20:05:15 -0700 (PDT), Leo Carnovale declaimed the following: > >Ah and one other thing! >What is this crypto algorithm you speak of? I desperately need some sort of encryption as at the moment anyone can simply open the text file and change the numbers to numbers that work! >Where can I learn more about it? Given the use of the term "pasw" (and variants thereof) in the snipped text... Are you trying to password protect access to the program (ie, a "login"), or hide the data in a recoverable state. Many "login" type passwords aren't encrypted -- they are hashed, possibly with a random starting seed created when the "login account name" is entered to the system. These never recover the password itself (well, supposedly they didn't but I believe cracks were found in the Linux passwd file such that the hash is now stored in a system level file in parallel, while the passwd file may have just the basics of the user login/owner/etc. -- since passwd had to be accessible to most user level programs). For "login", one matches the username in the password file, extracts the seed, then hashes the entered password -- the hash has to match the one in the file to be valid. If the user forgets the password, there is no way to recover it -- the most a sysop can do is generate a new password, enter its hash into the file, and tell the user what the new password is (along with instructions to change it as soon as they log in). For data hiding, a prior post provides information regarding symmetric (same key used in both directions -- a very simplistic approach would be to just XOR the data with the key (but this will reveal the length of the key if the data has a large stretch of identical values, say a line of ------------------------------------------------------ as the repeats of the shorter key will create the same output sequence). In the late 70s, the DES (data encryption standard) algorithm was supposed to be practically unbreakable by brute force (trial and error) and secure enough for international banking. 20 years later, desktop machines could break it in a few weeks, if not sooner, and Triple-DES came into use. Problem with symmetric keys? Both sides have to know the key before data can be transferred, and anyone who discovers the key can decrypt/modify/encrypt the data. Asymmetric (public key) systems use a pair of keys. One key is used to encrypt the data. The other key is used to decrypt it. They only work in one direction. If you publish the encryption key, anyone can use it to encrypt data which then can be sent to you, but only you can decrypt it with the other key. Vice versa, if you publish the decryption key but keep the encryption key secret, you can encrypt data that anyone with the public key can decrypt and read -- but only you can provide the data (this is how "signing" is normally done; only the holder of the signing encryption key could produce the signature). -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/