Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 8th, 2006, 9:51 PM   #1
Indigno
Professional Programmer
 
Indigno's Avatar
 
Join Date: Dec 2005
Location: Anywhere non-productive
Posts: 267
Rep Power: 0 Indigno is an unknown quantity at this point
Send a message via AIM to Indigno Send a message via MSN to Indigno Send a message via Yahoo to Indigno
Text encryption

For some reason I decided to make an encryption and decryption program. The encryption will include the following:
-Password Protection
-Protection against cracking the code (EG typing the alphabet and copying the code down)
-varying levels of encryption
-and anything else I think of along the way


I'm not cancelling the flash project, that's just on hold until I can get my friend over to help me with some of the art and such (most likely this weekend).

It will be written in Visual Basic (Because I don't really know anything else).

Expect an alpha sometime this weekend.
Indigno is offline   Reply With Quote
Old Feb 9th, 2006, 6:45 AM   #2
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
May I hope you are writing it in VB.NET? If not, you _really_ should.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Feb 9th, 2006, 8:37 AM   #3
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Visual Basic man? You need to broaden your languages a little bit. If you write it in VB.Net you may as well code it in C#. If you are using VB 6.0, get rid of it. You can SharpDevelop for free to help you out with VB.Net/C#. Looking forward to seeing the end result.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Feb 9th, 2006, 9:15 AM   #4
Master
Programmer
 
Master's Avatar
 
Join Date: Sep 2005
Location: GA
Posts: 99
Rep Power: 4 Master is on a distinguished road
I wrote a module in ruby that can encrypt string and decrypt string. if you want it, i can post it for you. then you could translate the code to another language or i could do that for you.
Master is offline   Reply With Quote
Old Feb 9th, 2006, 9:43 AM   #5
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
I'd be interested just to see the Ruby code... as I don't know Ruby at all.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Feb 9th, 2006, 12:12 PM   #6
swestres
Newbie
 
Join Date: Dec 2005
Posts: 13
Rep Power: 0 swestres is on a distinguished road
Will you use a professional encryption algorithm, or just some monoalphabetic substitution? OpenSSL's crypto library is quite nice, I guess blowfish whould do the trick nicely. Don't now if it supports VB though (or vice versa), but that's your headache
__________________
Here comes the SWAT team, and the M-16,
shoot the walls in, destroy the building.
Wolverine was sad and it made him mad,
every single cop got a bullet in the head.
swestres is offline   Reply With Quote
Old Feb 9th, 2006, 8:31 PM   #7
Indigno
Professional Programmer
 
Indigno's Avatar
 
Join Date: Dec 2005
Location: Anywhere non-productive
Posts: 267
Rep Power: 0 Indigno is an unknown quantity at this point
Send a message via AIM to Indigno Send a message via MSN to Indigno Send a message via Yahoo to Indigno
Quote:
Originally Posted by swestres
Will you use a professional encryption algorithm, or just some monoalphabetic substitution? OpenSSL's crypto library is quite nice, I guess blowfish whould do the trick nicely. Don't now if it supports VB though (or vice versa), but that's your headache
Kinda sorta both. I'll have it convert every symbol into a random one, then I'll run it through a really long and complicated equation (A couple of lines of equation.) and do a bunch of other wierd stuff to it which I'm not going to get into for the simple fact that I don't feel like typing it all out.

Oh, and I would use a different language, but to be perfectly honest, I can't seem to get delphi or any sort of c down quite right. I figured I would wait for my studies to get to that point. But I'm getting really impatient. I wish someone would contact me on an IM to tutor me

aim: BeanThingLock
YIM: Indigno_Studios
MSN: Kevinseth@gmail.com

much love to anyone that decided to give me a hand. I don't need hard tutoring, just kinda teach me the syntax and some commands n such.
Indigno is offline   Reply With Quote
Old Feb 10th, 2006, 3:05 PM   #8
Master
Programmer
 
Master's Avatar
 
Join Date: Sep 2005
Location: GA
Posts: 99
Rep Power: 4 Master is on a distinguished road
That is the code for it right there
class File
  attr_reader :name
  attr_reader :mode
  alias file_int initialize
  def initialize(*args)
    file_int(*args)
    @name = args[0]
    @mode = args[1] if !args[1].nil?
    @_self = self
  end
  
  def share(obj = nil)
    return if obj.nil?
    @_self = obj
  end
end


module Serialize
  W_MODE = %w[wb wb+ w+ w a]
  R_MODE = %w[rb rb+ a+ a]
  NOTWRITEABLE = "Instance of IO (write mode) is needed\n"
  NOTREADABLE  = "Instance of IO (read mode) is needed\n"
  CHAR = ";"
  $OPEN_N = 0
  module_function
  
  def encode(string)
    return if !string.is_a?(String)
    @str = string.unpack('B*')[0].tr('01', " \n")
  end
  def decode(string)
  return if !string.is_a?(String)
    [string.tr(" \n", '01')].pack('B*')
  end
  
  def save(data = nil, file = nil, depth = 0)
    return if data.nil?
    copyd = data#.deep_clone
    check =  data.is_a?(Array) || data.is_a?(String) || data.is_a?(Integer) || data.is_a?(Float)
    data = data.inspect.to_s
    temp = encode(data)
    name = nil
    mode = nil
    if !file.nil?
      if file.is_a?(File)
        name = file.name
        mode = file.mode
        raise NOTWRITEABLE if file.closed? || !W_MODE.include?(mode)
        if depth > 0
          new_file = File.new(name,mode)
          file.share(new_file)
        end
        file.write(temp)
        file.write(CHAR)
      else
        raise NOTWRITEABLE
      end
    end
    $Calls = copyd
    if file.nil?
      return $Calls
    else
      return temp
    end
  end
  
  def load_save(file = nil)
    msg = "No data to load\n"
    line = ""
    name = nil
    data = nil
    if !file.nil?
      $Calls = nil
    else
      if !$Calls.nil?
        return $Calls
      end
    end
      if file.is_a?(File)
        raise NOTREADABLE if file.closed? || !R_MODE.include?(file.mode)
        raise msg if FileTest.size(file.name) <= 0
        name = file.name
        if eval("$d_name.nil?")
          eval("$d_name = []; $c_name = 0") 
            while(true)
              break if file.eof?
              text = file.readline
              line += text
            end
          eval("$d_name = line.split(CHAR)")
        end
          eval("data = decode($d_name[$c_name])")
          eval("$c_name += 1")
          if !eval("$d_name.nil?")
            if eval("$c_name == $d_name.size")
              eval("$c_name = nil; $d_name = nil")
            end
          end
          begin
            return eval(data)
          rescue TypeError
            raise msg
          end
      end
  end
end
#usage
mystring = "Hello World"
myFile = File.open("filename","writemode")#filename = file to store data,mode = writemode"
Serialize.save(mystring) #this store the variable for later in the memory
Serialize.save(mystring,myFile) #this store the variable in a file for later
#you can call serialize.save as much as you want, that mean when you are loading, you have to use the same number of call for loading or less than. any greater will not load anything.
myFile.close()
myFile = File.open("filename","readmode")#filename = file to store data,mode = "readmode"
Serialize.load_save(myFile)
Master is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:44 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC