SMALL BASIC: How to create simple encryption and decryption program

Subscribers:
612
Published on ● Video Link: https://www.youtube.com/watch?v=VsyrljGFrT4



Duration: 15:08
50 views
2


SMALL BASIC: Creating simple encryption and decryption program.

Here is the code:
GraphicsWindow.Show()
Controls.ButtonClicked = gettext

'Placing the controls
desctext = Shapes.AddText("Message:")
Shapes.Move(desctext,0,0)
mtb = Controls.AddMultiLineTextBox(0,20)
desctext2 = Shapes.AddText("Key: ")
Shapes.Move(desctext2,0,120)
key = Controls.AddTextBox(0,140)
desctext3 = Shapes.AddText("Encryted Message: ")
Shapes.Move(desctext3,0,160)
mtb2 = Controls.AddMultiLineTextBox(0,180)

Controls.AddButton("Proceed",0,280)

Sub gettext
mtbt = Controls.GetTextBoxText(mtb)
keyt = Controls.gettextboxtext(key)
TextWindow.WriteLine("Original message: ")
TextWindow.Writeline(mtbt)
TextWindow.WriteLine("")

for i = 1 to Text.GetLength(mtbt)
mtbtp[i] = Text.GetSubText(mtbt,i,1)
Textwindow.Write("Character:" + mtbtp[i])
gc = Text.GetCharacterCode(mtbtp[i])
gcwk = gc + keyt
gce[i] = Text.GetCharacter(gcwk)
textwindow.Write(", Ascii code: " + gc)
TextWindow.Writeline(", Encrypted character: " + gce[i])
EndFor

TextWindow.WriteLine("")
TextWindow.ForegroundColor="yellow"
TextWindow.WriteLine("Encrypted message: ")

'Uniting encrypted characters as a string from array
enctext = ""
For i = 0 to Text.GetLength(mtbt)
TextWindow.Write(gce[i])
enctext = enctext + gce[i]
EndFor
Controls.SetTextBoxText(mtb2,enctext)
enctext=""
EndSub




Other Videos By Computertechlighthouse


2022-03-21How to import text file to google spreadsheet
2022-03-10How to erase Windows old installation files (Windows.old) on Windows 8.1
2022-03-06How to refill Epson L220 Printer
2022-02-20Rusia and Ukraina and End Times
2022-02-20Live Stream Totz Freelance
2021-11-14SMALL BASIC: How to make program that lists all the folder and subfolders of a defined path
2021-11-13SMALL Basic: Printing Binary Mountain pattern
2021-11-06How to derives sequence formula: 1,1,0,0,1,1,0,0,1,1.. and 1,1,1,0,0,0,1,1,1,...,...
2021-10-30How to referencing cell in OpenOffice Calc
2021-10-29How to generate arithmatic, geometric, and exponential sequences using Openoffice calc
2021-10-29SMALL BASIC: How to create simple encryption and decryption program
2021-10-29How to use conditional formatting on OpenOffice: Change cell's background color, etc.
2021-10-27How to make AND and OR function using IF function on OpenOffice Calc
2021-10-26SMALL BASIC: AND operation calculator
2021-10-03How to solve linear equation (3 equations with 3 variables) with OpenOffice Calc
2021-10-02How to generate 3 linear equations with 3 variables using OpenOffice Calc
2021-09-13Why Telnet traffic isn't secure (Capturing local Telnet traffic using Wireshark)
2021-09-12How to solve EOL Ubuntu's unable to install or update packages: error 404
2021-09-11How to play flash file in 2021
2021-09-09How to pause and unpause OBS recording and set their shortcuts
2021-09-09Installing Windows XP SP 3 in 2021 using VMware player 12



Tags:
SMALL BASIC
Encryption
Decryption
Simple encryption
Simple Decryption