Results 1 to 9 of 9

Thread: Encryption Algorithms

  1. #1

    Thread Starter
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Encryption Algorithms

    Howdy all,

    I'm wondering if there are any tutorials anyone has come across regarding advanced text encryption. I want to see how uncrackable I can get a small text file.

    Hopefully I can possibly transpose this onto pictures aswell.

    Thanks in advance,

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Encryption Algorithms

    I like to use Capicom, which Microsoft released. It encrypts differently each time, based on the time. It decrypts perfectly! You can google it.

    I haven't encrypted files, but I'm pretty sure it would be possible. I have only encrypt text strings.

  3. #3

    Thread Starter
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Encryption Algorithms

    I really only want to encrypt text strings (in turn, the text files). Can you provide any articles which have some algorithms or theory behind text encryption?

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Encryption Algorithms

    You mean other than Capicom? This is something that I have also used.

    VB Code:
    1. Dim ff As Integer
    2. Public st As String
    3.  
    4. Private Sub Form_Load()
    5.     ff = FreeFile
    6.     Dim strBuff As String
    7.     ff = FreeFile
    8.     Open App.Path & "/site.txt" For Input As #ff
    9.     Do Until EOF(ff)
    10.        Line Input #ff, strBuff
    11.     Loop
    12.     Close #ff
    13.     Text1.Text = RC4ED(strBuff, "837ufhjjkddQR13%^&*&@#$&9ASFewFDAAW!%9367")
    14.     Call WriteFile
    15. End Sub
    16.  
    17. Sub WriteFile()
    18.  ff = FreeFile
    19.     Open App.Path & "\site.txt" For Output As #ff
    20.         Print #ff, Text1.Text ' <-- Might need to use Write # to add quotes
    21.     Close #ff
    22. End Sub
    23.  
    24. Function RC4ED(InString As String, password As String) As String
    25.  
    26.     Dim S(0 To 255) As Integer
    27.     Dim K(0 To 255) As Integer
    28.     Dim I As Integer, j As Integer, tmp As Integer
    29.     Dim t As Integer
    30.     Dim outstring As String
    31.  
    32.  
    33.     For tmp = 0 To 255
    34.         S(tmp) = tmp
    35.         K(tmp) = Asc(Mid(password, 1 + (tmp Mod Len(password)), 1))
    36.     Next
    37.  
    38.  
    39.     For I = 0 To 255
    40.         j = (j + S(I) + K(I)) Mod 256
    41.         Swap S(I), S(j)
    42.     Next
    43.  
    44.     I = 0
    45.     j = 0
    46.     outstring = ""
    47.  
    48.  
    49.     For tmp = 1 To Len(InString)
    50.         I = (I + 1) Mod 256
    51.         j = (j + S(I)) Mod 256
    52.         Swap S(I), S(j)
    53.         t = (S(I) + S(j)) Mod 256
    54.         outstring = outstring & Chr((mXor(S(t), Asc(Mid(InString, tmp, 1)))))
    55.     Next
    56.  
    57.     RC4ED = outstring
    58. End Function
    59.  
    60.  
    61. Function mXor(I As Integer, j As Integer) As Integer
    62.  
    63.  
    64.     If I = j Then
    65.         mXor = j
    66.     Else
    67.         mXor = I Xor j
    68.     End If
    69.  
    70. End Function
    71.  
    72.  
    73. Sub Swap(ByRef a As Integer, ByRef b As Integer)
    74.  
    75.     Dim t As Integer
    76.     t = a
    77.     a = b
    78.     b = t
    79. End Sub

    Here's a link. Run the program twice. First time encrypts, second time decrypts.
    http://vbforums.com/attachment.php?attachmentid=37573

  5. #5

    Thread Starter
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Encryption Algorithms

    Thanks for that DG, can start to fiddle with some things now

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  6. #6
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Encryption Algorithms

    I did not use it for a while, but you got encryption build into .Net

    Check this out for a starter: RSA in VB.NET
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  7. #7
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Encryption Algorithms

    VS.net has a whole namespace full of encryption classes. Gives you full control of everything. You won't get any much more uncrackable than that.

  8. #8

    Thread Starter
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Encryption Algorithms

    I kinda want to see how far I can go with my own. I also hoped to make a voice recognition decryption. The person says the password, and the text is decrypted. I might actually look alot deeper than I originally was for this..

    Ta though

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  9. #9
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Encryption Algorithms

    Quote Originally Posted by chemicalNova
    I kinda want to see how far I can go with my own. I also hoped to make a voice recognition decryption. The person says the password, and the text is decrypted. I might actually look alot deeper than I originally was for this..

    Ta though

    chem
    huh? whatever you are smoking, I want some too!
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

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