TRENDING NEWS

POPULAR NEWS

What Code Or Cipher Is Best To Condense Writing

Why can't I write a single line of code? I’ve read many books on algorithm, programming languages, and design principles, but I am stuck and cannot write code at all.

You know, I've met quite  few people like you (even a few in grad school, although they didn't make it too far...but I suspect they've since learned the ropes).  I'm guess you've spent a lot of time focused on solely on the theoretical side of things, and only touched programming in a very "controlled" environment.  I suppose part of the problem is the classroom environment, where it's convenient to condense what you want students to build into a single section that's been over-specified and sanitized to death. Ask some students to build a piece of software from scratch and you'll likely wind up with a blank stare.  Here's what you do step by step. It's basically the same process that you'd start with for any planning task.  Figure out what your end result should beFigure out where you are nowDefine the interface (API) that fits the use case, run through a few dry erase board scenarios to make sure that your interface fits the edge casesStart filling in the blanks to make the interface work with pseudocode.  Sometimes this isn't so easy, but once you have the interface defined...everything gets a bit easier.  Decide which language fits the use case, languages are tools.  Python shouldn't really be used for performance based code and neither should C be used for text processing (well, unless it's performance critical text processing)Figure out how you can re-use as many libraries as possible now that you have a language in mind (in general this is a good idea, especially libraries that are relatively standard)Get coding.....if you run into specific issues then start surfing language specific pages or stack exchange (if you're really horrible at syntax, get a highlighting and auto-complete IDE such as Eclipse, Netbeans, Komodo, Sublime, etc.  I personally like vim, although emacs is nice too once you get used to it)Rinse and repeat as necessary.Hope this helps.....seems to be the process I use quite a bit.  Coincidentally the same steps I used here are basically the steps that the Army taught me to plan a mission.  Start with the end case and plan your way to where you want to go given the time.  The key is don't spent too much time on the planning stages otherwise you'll never get anywhere.  Usually 20% planning and 80% doing, that way you'll at least end up with something done.  Like Patton said, "A good executed violently is better than a perfect plan executed next week."  Very smart guy, just find replace the violently for enthusiastically. Good luck!

How is data encrypted and decrypted in QR code, in simple terms?

In simple terms, encrypt the data to be embedded in the QR and then embed it. Send the encryption key separately and securely to the receiver so that he/she may use the key to decrypt the decoded message from the QR code.Anyway, There are several ways you can achieve that and the complexity would completely vary based on:What you are encrypting?How you are encrypting?Where on the QR code you are encrypting (embedded as data or as the picture)?Read the following papers and you might understand the different variations:Confidential Encrypted Data Hiding and Retrieval Using QR Authentication System: http://ieeexplore.ieee.org/docum...New generation of digital academic-transcripts using encrypted QR code™: Use of encrypted QR code™ in mark-sheets (academic transcripts): http://ieeexplore.ieee.org/docum...Advanced Steganography Algorithm Using Randomized Intermediate QR Host Embedded With Any Encrypted Secret Message: ASA_QR AlgorithmSD-EQR: A New Technique To Use QR CodesTM in Cryptography: Use of QR CodesTM In Data Hiding and Securing

How should I start cryptanalysis of my own symmetric key encryption algorithm?

I don’t know what kind of symmetric encryption algorithm you have designed, but in general, you have to keep the repetition of patterns in the cipher text to a minimum. To check that, use a compression program like winzip and compress the cipher text file and note the % compression. If the compression is too high, you can conclude that the cipher is not doing a good job. Less compression possible means no pattern, less chance of breaking. The value like <10% compression is good. Another useful thing is frequency analysis of the characters in the cipher text. See that the occurrence of each character in the cipher text is equally probable- to avoid the code breaker from detecting any code pattern in the output.

I am making my own encryption program. Is it possible to make it so complex it becomes easier to decrypt, rather than harder?

Absolutely yes.Back during my days at LLNL we found some physicists were using a popular but insecure set of programs in order to make file transfer easier. After having access to those codes disabled one of the physicists, infamous for both his arrogance and his political clout, started pushing for the installation of his own set of programs. I was one of three security experts that was invited to review those programs for any issues. We found several fatal flaws, leading to the proposal being rejected. The physicist was quite upset and stormed out of the meeting. As he left he snapped, “You folks should read ‘Applied Cryptography’. You might learn a few things!” I just smiled. I was one of the technical editors for that book ( was a member of the USENET newsgroup for cryptography ). Still have the early chapters Bruce Schneier had emailed me for mark up.Making a good crypto system is not easy. First off, you can’t hide the algorithm - it has to hold up to being known by the ‘enemy’. Second, the method does not need to be complex, but the decryption has to sufficiently hard to guess that you get good protection. Which is why many methods use the product of large prime numbers as keys for the cypher - factoring the result back to find the original numbers is very time consuming.If and when you think you have a strong system put it up for review and be prepared for some brutal, but honest, replies as experts try their best to find any problems. Do your homework first to avoid looking like a fool.

How do I solve programming problems faster? What else than sheer practice will make me faster?

To solve programming problems more quickly, do the following.Keep track of what consumes time. Is it that you think about perfecting the algorithm too long before starting to code? Or you code too soon, with several false starts and have to throw away the code you wrote? Or that you are very slow in writing the code, and not quite sure whether to use an ‘if’ or a ‘switch’ or some other construct? Figure out where the time is going.Work on improving the time consuming part.If you aren’t starting code within a few minutes of getting the problem, you should. Write up code with the intention of throwing it away. One trick I use is to write down the algorithm as comments, and then write code around it. It turns out you don’t usually have to throw away the code - though sometimes you do.If you’re getting several false starts on the problem and having to throw away your work, you’re not thinking far enough along in your solution. Spend more time thinking through the problem you want to solve. Come up with the bones of a solution. Then start coding. Again, writing down the algorithm as comments can be very helpful.If you’re not picking the right constructs, go with your first choice, work all the way through, and only then should you worry about cleaning up the code. If you have time, re-write it with more efficient statement choices. Otherwise, at least you’ve solved the problem and learned something you can apply next time you code a similar routine.Practice is great, but you need to practice the right thing, whatever is slowing you down. For now, write down a simple version of your algorithm in comments, then flesh it out. Here’s an example of me doing that for a ‘countSubstrings’ function or program.// count the number of instances of a string in a bigger string
// check to make sure both strings are valid
// ? do I need to be case insentive? what about spaces?
// starting with each character (from the left) in the string to check
// see if the string from there matches.
// increment count if match, else continue.
// return the number of matches

TRENDING NEWS