Encryption

Discussion in 'Software' started by sizjam, Jul 10, 2003.

  1. sizjam

    sizjam Specialist

    hey people, can anyone please give a newbie (me) some pointers on a language that will allow me to vreate a program which means i can encrypt files? eg assign an alphanumeric character in place of another one? i w as thinking to do this in VB, but anythihng else would be greatly appreciated :)

    thanks
     
  2. Njal

    Njal Private E-2

    You can do encryption in any language, and most have pre-built encryption modules or functions that can be found readily. If your looking for strong encryption those algorithms are quite extensive but you can make a simple XOR encryption that would work for most non-critical roles.

    The functions in VB would look something like this:
    Function Encrypt(fileText As String) As String
    'XOR encryption
    Dim i
    i = 0
    Dim curChar As String
    Dim newText As String
    newText = ""
    For i = 1 To Len(fileText)
    curChar = Mid$(fileText, i, 1)
    newText = newText + (Asc(curChar) Xor Asc(XORKey))
    Next i
    Encrypt = newText
    End Function

    Function Decrypt(fileText As String) As String
    'XOR Decryption
    Dim i
    i = 0
    Dim curChar As String
    Dim newText As String
    newText = ""
    For i = 1 To Len(fileText)
    curChar = Mid$(fileText, i, 1)
    newText = newText + (Asc(curChar) Xor Asc(XORKey))
    Next i
    Decrypt = newText
    End Function
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds