Thread: Encryption

Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Tucson AZ
    Posts
    29
    Rep Power
    0
    I've recently taken an art appreciation course at the local college and as a final project we had to try 'art' something of our choosing.

    I decided to write a small program that converts files into an image.

    It's very simple, but it was hard coded for the class. It can be easily modified - I was just going for 'quick'.

    As an example of this program it can take the 64 page news.txt file that comes with python and convert it into a bmp (black and white dots) and this image would print out on just a little over one page. It's a fun program to play with... and you can modify it to change the way the image is created without much work.

    The current program does not take into consideration upper/lowercase letters or special symbols (ones that can't be directly accessed from the keyboard).

    So if you'd like the current program, I don't have time right now to make modifications, you can e-mail me for it or send me an instant message... my information is in my profile. Just remember the following:

    1) There are 2 programs one to convert a file to a bitmap and the other to convert the bitmap to a text file.

    2) It's hard coded to convert test.txt to test.bmp
    and vice versa. So one of these files must be in the directory depending on which program you are running, or you need to modify the programs.

    3) The size of the image is dependent on the size of the file... therefore the image size won't be larger than the size of the text document.

    4) It only encrypts certain characters... and ingnores case.. which means when decrypted it will be all lowercase and special characters lost.

    5) This program was written to perform a task and was not written with much versatility. However, it should not take long to make it versatile, it was something simple and just for fun. So you can have fun with it.

    And of course - if you have questions ask...
  2. #17
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    25
    Rep Power
    0

    Lightbulb PySimpleCrypt


    Here is a new interface to the Python Cryptography Toolkit I wrote. It's pretty good. Here it is if anyone wants it.

    Current version: 2.0
    Now on PyPI: http://www.python.org/pypi?:action=d...pt&version=2.0

    Notes: Documentation and examples included. RSA fixed.
    Attached Files
    Last edited by TheBlackMamba; November 3rd, 2003 at 07:25 PM.
  4. #18
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    325
    Rep Power
    12
    just a simple note TlacMamba,
    instad of

    if type(Key) != type(""):
        raise TypeError, "Key must be a string"

    you could use:

    if not isinstance(Key):
        raise TypeError, "Key must be a string"

    It's a function specifically for checking types of an object. Just thought u might like to know
    Nice code btw .. aint python nice =P
    Eli
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo