| |||||||||||
| |||||||||||
Python security - trouble with input
The danger of Python's input function - also known as giving away your secrets to your user.
If you're writing a Python program and asking your user for input, you should always use the raw_input function and never input. Why? Because what you type to input is interpretted through an expression and the result is saved into your target variable ... so not only does input assume that your user knows Python syntax, but it also opens some great little security holes. Look at this program. Something = "your toes"And look how easy it is to find out all the variables that are used inthe program, and their contents: earth-wind-and-fire$ python dainFirst run ... find out what all the defined variables are called. Second run ... start reading those variables. Ouch! (written 2006-11-30 07:53:25) Associated topics are indexed under Y102 - Python - Fundamentals
Some other Articles
1st, 2nd, 3rd revisited in RubyIt's the 1st, not the 1nd 1rd or 1th. Plain Ole nice pictures Improving the historic town of Melksham Python security - trouble with input Python collections - mutable and imutable Splitting Pythons in Bradford Christmas in November Coming from London to Melksham by train for a course What happened at Geekmas 1637 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||