Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Tutorial 

Making a Basic Crypter Using RealBASIC/RealSTUDIO/XOJO [FUD][AES Encryption]

Today's Lesson will be about how to make a platformed Cryptor that is FUD using AES encryption methods. Please type all codes. (there are some bugs that may cause file corruption)

You need the following
  • RealBASIC or RealSTUDIO or XOJO (Realbasic.com)

  • MonkeyBread Plugins (monkeybreadsoftware.de)
    • Plugin Downloads

    • [img]http://www.monkeybreadsoftware.de/realbasic/images/apple.png[/img]Mac OS X

    • [img]http://www.monkeybreadsoftware.de/realbasic/images/windows.png[/img]Windows

    • [img]http://www.monkeybreadsoftware.de/realbasic/images/linux.png[/img]Linux




Now that you have the Items you need to start lets begin.

You will need to add the following to Window1 of your Project!
  • 2x Label

  • 2x TextField

  • 3x Bevel Button


BevelButton1 Should say Crypt
BevelButton2 Should say Instructions
BevelButton3 Should say Generate
Label1 Should say Executable: or File:
Label2 Should say Key:
TextField1 Should say test.exe
TextField2 Should Say Encrypt Key

Once your done the GUI should look like this
[img]http://s7.postimg.org/cynj8ykuz/Crypter_Window.png[/img]

Congratulations!! you just finished the GUI!!!! Now lets get to writing our code!

We start buy setting up our methods and properties that will be called upon in other areas of the program!

Your 1st Method will be DecryptAES
  • Method Name: DecryptAES

  • Parameters: key as string, sourcefile as FolderItem, destfile as FolderItem

  • Return Type: Boolean


Code
// decrypt file with AES and CFB

  dim a as AESMBS = NewAES(key)
  if a = nil then Return false

  dim bi as BinaryStream = sourcefile.OpenAsBinaryFile(false)
  if bi = nil then Return false

  dim bo as BinaryStream = destfile.CreateBinaryFile("")
  if bo = nil then Return false

  dim IVectorOffset as integer = 0
  dim IVector as new MemoryBlock(16)

  dim data as string = bi.Read(100)
  while lenb(data)>0

    dim idata as MemoryBlock = data
    a.DecryptCFB(idata, lenb(data), IVectorOffset, IVector, nil, 0, 0)

    bo.Write idata

    data = bi.Read(100)
  wend

  bo.Close
  bi.Close

  Return true

  // exception handler for newer Real Studio version
  'Exception io as ioexception

  if bo<>nil then
    destfile.Delete
  end if

Your 2nd Method will be EncryptAES
  • Method Name: EncryptAES

  • Parameters: key as string, sourcefile as FolderItem, destfile as FolderItem

  • Return Type: Boolean


Code
// encrypt file with AES and CFB

  dim a as AESMBS = NewAES(key)
  if a = nil then Return false

  dim bi as BinaryStream = sourcefile.OpenAsBinaryFile(false)
  if bi = nil then Return false

  dim bo as BinaryStream = destfile.CreateBinaryFile("")
  if bo = nil then Return false

  dim IVectorOffset as integer = 0
  dim IVector as new MemoryBlock(16)

  dim data as string = bi.Read(100)
  while lenb(data)>0

    dim idata as MemoryBlock = data
    a.EncryptCFB(idata, lenb(data), IVectorOffset, IVector, nil, 0, 0)

    bo.Write idata

    data = bi.Read(100)
  wend

  bo.Close
  bi.Close

  Return true

  // exception handler for newer Real Studio version
  'Exception io as ioexception

  if bo<>nil then
    destfile.Delete
  end if

Your 3rd Method will be NewAES
  • Method Name: NewAES

  • Parameters: key as string

  • Return Type: AESMBS


Code
dim a as new AESMBS

  // all keys should be UTF-8
  key = ConvertEncoding(key, encodings.UTF8)

  dim bits as integer = 0
  dim l as integer = lenb(key)

  // pad key to required length for 16, 24 or 32 bit key

  if l>32 then
    key = leftb(key,32)
  elseif l>24 then
    while lenb(key)<32
  key = key + " "
    wend
  elseif l>16 then
    while lenb(key)<24
  key = key + " "
    wend
  else
    while lenb(key)<16
  key = key + " "
    wend
  end if

  if a.SetKey(key) then
    Return a
  end if

Your last Method will be RandStr
  • Method Name: RandStr

  • Parameters: ranlen As Integer, nmb As Boolean, lcs As Boolean, ucs As Boolean, smb As Boolean

  • Return Type: String


Code
Dim source As String = ""
  if nmb = True then source = source + "1234567890"
  if lcs = True then source = source + "abcdefghijklmnopqrstuvwxyz"
  if ucs = True then source = source + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  if smb = True then source = source + "|@#~$%()=^*+[]{}-_"
  Dim chrstr,num As String
  Dim NumChar,start,i As Integer
  NumChar = source.Len( )
  for i = 1 To ranlen
    Dim r as New Random
    start = r.InRange( 1, NumChar )
    num = source.Mid( start, 1 )
    chrstr = chrstr + num
  Next
  return chrstr

We have now set up all the methods and properties needed for this program to function now we need to make the GUI work. Let us Continue...

We will start with BevelButton1
Code
dim key as string = TextField2.text

  dim sourceFile as FolderItem = SpecialFolder.Desktop.Child(""+ TextField1.text +"")
  dim encryptedFile as FolderItem = SpecialFolder.Desktop.Child("Crypted.exe")
  dim decryptedFile as FolderItem = SpecialFolder.Desktop.Child(""+ TextField2.text +"")

  if sourceFile.Exists = false then
    MsgBox "Please add the file to your desktop."
  end if

  if EncryptAES(key, sourceFile, encryptedFile) then
    if DecryptAES(key, encryptedFile, decryptedFile) then
  MsgBox "OK"
  decryptedFile.Launch
    else
  MsgBox "Failed to decrypt."
    end if
  else
    MsgBox "Failed to encrypt."
  end if

Now we move on to BevelButton2 (This will bring up your second window! I will cover how to make this window later on in the Tutorial!)
Code
Window2.show

Now to BevelButton3
Code
TextField2.Text = RandStr(15, True, True, True, True)

Now that the Application will work we will finish by making the Instructions Window! That BevelButton2 Reveals

You need to Add a TextArea to the Window and a BevelButton!

Your Window should look like this...
[img]http://s9.postimg.org/91ndf6fz3/Window_2.png[/img]

You will need to add this code to your Close BevelButton
Code
window2.hide

This Concludes my Tutorial I hope this enlightens people on coding a Crypter for Mac/Linux/Windows Operating Systems! Remember this is BASIC, However the Tutorial is for more Intermediate Coders.
Can i do it with VB.NET, Why i need to use that??
BTC : 1LjR87CZ5apfHkQG5MkkubbB8Hf7HUesqJ

[Image: 3QQXuOY.png]
(Oct 17, 2013 11:48 PM)Naveen Wrote:  Can i do it with VB.NET, Why i need to use that??

Because VB.NET Uses Dependencies this does not.. And its a Different Language...
Thanks. Finally, a tutorial for xojo!
I am the best coder on this forum when it comes to XOJO ^_^
Hey I am actually having trouble with this, whenever I try to run the program it works fine until I try to crypt the file. It says that the program has stopped working whenever I try to crypt a file. Any suggestions as to what might be the problem? It's not a problem with the code because that would show up. Also, I'm using a free version of xojo so I have to run the program directly I can't build it, maybe that's the problem?
You need the Monkeybread Plugins, and you also need to type the name of the file being crypted and make sure its on the desktop. I do not use XOJO btw I only use RealSTUDIO 2012 Pro version (the one I paid for)
why does mine fail to compile?
I have the encryption plugin installed
https://i.imgur.com/KRCz90T.png
(Nov 4, 2013 06:14 PM)dfiles Wrote:  why does mine fail to compile?
I have the encryption plugin installed
https://i.imgur.com/KRCz90T.png

XOJO Might have different syntax, I use RealSTUDIO
Maybe you are using another version of the plugins?

(Nov 5, 2013 01:50 AM)Tyler777 Wrote:  XOJO Might have different syntax, I use RealSTUDIO

Nope the syntax is the same (especially with 2012r2.1 which I guess you use).
Once you get to the bevelbuttons stuff how do you add the code. Sorry for the stupid question.
(Mar 17, 2014 11:40 PM)BlackHoax Wrote:  Once you get to the bevelbuttons stuff how do you add the code. Sorry for the stupid question.

In order to add code to the bevel buttons you must first right click them, select "Add to bevel button %buttons name here% at the top, then click event handler, at the event handler (Depending on when you want your code to be implemented I'm assuming, "I'm just telling you out of my brief experience") for this case I chose action, as it says "The bevel button has been clicked" on the right hand side. However, I could use a hand with some code errors I'm experiencing but cannot PM yet,

Window1.DecryptAES, line 19 - This item does not exist (a.DecryptCFB(idata,lenb(data),IVectorOffset,IVector,nil,0, 0)

Window1.EncryptAES, line 19 - This item does not exist (a.EncryptCFB(idata, lenb(data),IVectorOffset,IVector, nil,0, 0)

I would very much appreciate a response to this post in the hopes that somebody that has gotten this working will read this and take the time to reply. (cannot currently pm, under 25 posts)


Possibly Related Threads...
Thread / Author Replies Views Last Post
by rjusticemiSep 5, 2025 05:57 PM 6 336 Sep 5, 2025 05:57 PM
Last Post: DarkVision
by LeerizJul 3, 2025 09:36 AM 2 375 Jul 3, 2025 09:36 AM
Last Post: Leeriz
by Tyler777Oct 13, 2013 03:56 PM 10 2,109 Oct 13, 2013 03:56 PM
Last Post: keesvwaal