Results 1 to 17 of 17

Thread: Encryption

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Pittsburgh, PA
    Posts
    329
    I made a program that does encryption. How it works is it takes the letter to be encrypted and adds its to ASCII value to the ASCII value of the one of the letters of the password. It repeats the process on every letter to be encrypted.

    For example:

    To encrypt "happy"
    With password: "day"


    Output =
    (ASCII of h + ASCII of d) +
    (ASCII of a + ASCII of a) +
    (ASCII of p + ASCII of y) +
    (ASCII of p + ASCII of d) +
    (ASCII of y + ASCII of a)
    it then converts the values in ()'s to a new character.


    I want to know 4 things:

    is vb going to do this very slowly?

    is this powerful enough for standard "home use"? - e.g. encrypting a saved AIM conversation

    how powerful would you consider this?

    is this really encryption or more a cypher ora mix or what?



    Thanks!!





    ______________

  2. #2
    Member
    Join Date
    Jul 2000
    Posts
    37

    hmmmmm

    Can your app change the encrypted file back again?

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Go look on my homepage to do keyencryption, the fastest possible way
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Kedaman i tried your Encryption with key function from your website but how do you decrypt with the key?

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Hint: Use the same key
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    Lively Member
    Join Date
    Apr 2000
    Posts
    70

    Talking

    If you use the XOR function it will be much stronger encryption. You can use the XOR function on the two ascii values, instead of adding them. (ie. asc(characterfromkey) XOR asc(charfromstring)) this function will then return a value less than 255 and greater than 0, so you need not check if it will be a valid ascii char, just get the chr() of it.. see some sample code:
    Code:
    Public Function EncryptData(MyKey as String, MyText as String)
    Dim ValueOut as String
    Dim i as Integer
    Dim KeyPos as Integer
    ValueOut = ""
    KeyPos = 0
    For i = 1 to Len(MyText)
         KeyPos = KeyPos + 1 'increment position in key by 1
         If KeyPos > Len(MyKey) Then KeyPos = 1 ' check if it is greater than the length of the key, if so, reset to one (this cycles the key)
         ValueOut = ValueOut & Chr(Asc(Mid(MyText,i,1)) XOR Asc(Mid(MyKey,KeyPos,1))) ' Add the character created by the XOR to ValueOut 
    Next i
    EncryptData = ValueOut 'return ValueOut
    End Function
    You can then call this function by using EncryptData("SomePassword","SomeText")
    The good bit is, you can encrypt something with it, then to decrypt it, simply call the same function, with the same key but supply the encrypted text as the MyText parameter. ie. EncryptData("SomePass","SomePreviouslyEncryptedData")

    Thats all for now.
    Want anymore info/help, email me (Joe@ihaveastupidlylongdomainname.com)
    Daniel Rose
    VB 5.0 Enterprise.
    irc:irc2.dynam.ac

    If TheCodeInTheSig() Is Not Lame() Then IDontKnowWhatIs()

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Pittsburgh, PA
    Posts
    329
    i see how to use xor but what exactly does xor do?
    ______________

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Xor the same as
    not(A or B) or (A and B)
    That means if A and B ar equal, the result is false, otherways true. shematically
    0 Xor 0 = 0
    1 Xor 0 = 1
    0 Xor 1 = 1
    1 Xor 1 = 0
    For nonboolean variables, like 6 or 397539.237 you compare bitwise, therefore each bit cannot infect other bits. That also means you can Xor with the same value again and get back to the original value, without giving other options, even for nonboolean variables.

    So you can Xor the ascii values, Go look at my homepage again, use Strconv and convert the the string into a byte array and then work each byte separately, Xor will operate each bit separately anyway.

    Encrypting by Xor is effective only if you use an effective key, that means it's long enough to be secure, and nongeneric that means no long series of 0es and 1, or even same byte types. You can for instance use Random seed to make a string nongeneric. The KKRSE encryption (on my homepage) is an example of that.

    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  9. #9
    Lively Member
    Join Date
    Apr 2000
    Posts
    70
    Xor encryption is more effective than simply adding or multiplying ascii values regardless of keylength. As for random seeds, you cannot use a random seed in anything you wish to decrypt, unless you store the random seed somewhere (as it is random, you dont know what it is) which defeats the purpose to an extent. It is much simpler to mess around with a key provided, for example, repeat it many times over, then xor each character with its neighbour etc. etc.
    Daniel Rose
    VB 5.0 Enterprise.
    irc:irc2.dynam.ac

    If TheCodeInTheSig() Is Not Lame() Then IDontKnowWhatIs()

  10. #10
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Talking Not random - pseudorandom

    A random seed is like a part of the key, the same seed gives the same series of numbers, If You have the key private, anyone else can still pass generic data trough the encryption and find out the key, as for random numbers you won't be able to get the key without knowing the random seed, a much harder aproach to crack.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  11. #11
    Member
    Join Date
    Jul 2000
    Posts
    37

    Legal issues

    Hey HAVocINCARNATE29,

    If this program you made is for your own use, fine. But if you want to sell it, well ummm, you should check legal issues. I'm no expert on this, but I've heard that there may be goverment standerds that encyption software has to follow. Again, I'm not for sure.

    Any other feed back on this?


  12. #12
    Lively Member
    Join Date
    Apr 2000
    Posts
    70
    if you use a random value to encrypt something anywhere in your method, you will not be able to decrypt it, therefore to decrypt it you must have the random value stored somewhere, thus making the random number feature useless
    Daniel Rose
    VB 5.0 Enterprise.
    irc:irc2.dynam.ac

    If TheCodeInTheSig() Is Not Lame() Then IDontKnowWhatIs()

  13. #13
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049
    Random seed is bad
    Napster is good..

    darn.. I really should stop watching those weird cartoons
    --
    But seriously.. Caphs is right; The only way you can decrypt is to save all the random numbers into a .key file or something

    (PGP-alike? )



  14. #14
    Lively Member
    Join Date
    Apr 2000
    Posts
    70
    mmm yes pgp did used to be good didnt it? :P
    Daniel Rose
    VB 5.0 Enterprise.
    irc:irc2.dynam.ac

    If TheCodeInTheSig() Is Not Lame() Then IDontKnowWhatIs()

  15. #15
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049
    Yeah that's why PGP is -> still <- the best encryption company in tha big business

    But it is very simple...

    2 keys. 1 public to SEND, 1 private to Decode it..

    The public one has the most info in it




  16. #16
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    CHAPS, did you read what i wrote? Read it again please
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  17. #17
    Lively Member
    Join Date
    Apr 2000
    Posts
    70
    i read it, its just not good imo to store any part of the key.
    Daniel Rose
    VB 5.0 Enterprise.
    irc:irc2.dynam.ac

    If TheCodeInTheSig() Is Not Lame() Then IDontKnowWhatIs()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width