473,651 Members | 2,793 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB Help with crypto program

1 New Member
HELP!!!!!

I have to write a program that does this:

Create a program that encrypts and decrypts a message...

Inputs: A typed message

Output: When the encrypt button is clicked the input message is encrypted. When the Decrypt button is clicked, the message is decrypted.

the encrypted button is clicked...this adds 1 to the ASCII value of a letter; therefore, if the word "Hello" is typed into the textbox, the letters "Ifmmp" would be displayed in the encrypt text box. The Decrypt button reverses the process by subtracting 1 from the ASCII value.

Additional Info: The program should include encrypt message, decrypt message, clear and exit buttons. their functionality is as follows:

The encrypt message button takes the message button takes the message entered into the first textbox. It then breaks the message down into its individual letters and converts it to ASCII. Once that is done, it adds one to the ASCII value and displays it in the second textbox.

The code to declare a char array and store the values from the first textbox is as follows:

Dim chrArray(() As Char = txtMessage.Text .ToCharArray

You will use a For Next loop to process every letter in the message. You will use 0 for the lower bound and chrArray.GetUpp erBound(0) for the upper bound.

You will use the chr() and asc() functions to find the next higher ASCII value. Chr(Asc(chrArra y(intCount)) + )

Once the new ASCII value is found, display it in the second textbox.

The dexrypt message button takes the encrypted message in the second textbox. It then breaks the message down into its individual letters and converts it to the third textbox.

When the Clear button is clicked, the program should clear data out of all 3 textboxes.

When the Exit button is clicked, the program should terminate.


The program should use error handling and display a message box containing the following text "ID10T Error" when an error is encountered.

Comments should be used to document how the program functions.

Evaluation Criteria:

1) All labels, textboxes and command button display the correct cation
2) The listbox and command buttons names use proper Hungarian notation and camel casing
3) The exit button terminates the program
4) The sclear button clears all textbox data before any new data is added
5) The encrypt message button correctly encrypts the input message
6) The decrypt message button correctly decrypts the encrypted message
7) Error handling functions correctly
8) Comments are used to document processing
9) Message box functions correctly
10) All text data is converted to the appropiate type

Heres what I have so far.....
Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.  
  3.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  4.        Handles Button1.Click
  5.              Dim strArray() As String + txtInput.Text.Split(",")
  6.              Dim intHold As Integer
  7.              Dim intX As Integer
  8.              Dim intY As Integer
  9.              Dim inArray(strArray.GetUpperBound(0)) As Integer
  10.              For intCount As Integer = 0 To strArray.GetUpperBound(0)
  11.                    intArray(intCount) = CType(strArray(intCount), Integer
  12.  
  13. Next
  14.  
  15.              'sort
  16.              For intX = 0 To intArray.GetUpperBound(0)
  17.                    For intY = 0 to intArray.GetUpperBound(0)
  18.                          If intArray(intX) < intArray(intY) Then
  19.                             intHold = intArray(intY)
  20.                             intArray(intY)  = intArray(intX)
  21.                             intArray(intX) = intHold
  22.                          End If
  23.                    Next
  24.              Next
  25.  
  26.                 Dim strOutput As String = ""
  27.                 For Each strItem As String In strArray
  28.                       strOutput & ","
  29.              Next
  30.  
  31.              txtOutput.Text = strOutput.Trim(",")
  32.              Next
  33.        End Sub   
  34. End Class
Something isn't right and I don't know what to do....By this what should the names of the buttons and boxes be....maybe I have that wrong? What would make it work?

Help me PLEASE>>>>

Angi Nelson

removed mail id
Mar 16 '08 #1
0 1239

Sign in to post your reply or Sign up for a free account.

Similar topics

1
7947
by: wqhdebian | last post by:
As far as I know,when encrypt or decrypt ,a key must first be got,and the key is first generate by a tool or from SecurityRandom,that means I can not generate the same key with the same input.Does there is a method which can generate a same with the same input string? There is a need to transfer file between to site,and the customer wish to encrypt these files during transfering,and they want to store a string into each database at...
1
2819
by: akickdoe22 | last post by:
Please help me finish this program. i have completed the addition and the subtraction parts, but i am stuck on the multiplication and division. any suggestions, hints, code, anyhting. it's not a true large int calculator, the numbers entered are at max 100 intergers. CODE SO FAR: #include<iostream> //libraries limited to #include<string> using namespace std;
2
3776
by: Bryan Olson | last post by:
The current Python standard library provides two cryptographic hash functions: MD5 and SHA-1 . The authors of MD5 originally stated: It is conjectured that it is computationally infeasible to produce two messages having the same message digest. That conjecture is false, as demonstrated by Wang, Feng, Lai and Yu in 2004 . Just recently, Wang, Yu, and Lin showed a short- cut solution for finding collisions in SHA-1 . Their result
9
1707
by: Lauren Wilson | last post by:
Hi Folks, We've been using Crypto ++32 to control licensed access to our widely distributed Access 2K app. Unfortunately, Sampson Multimedia appears to be out of business. Does anyone out there have recommendations for an alternate method of locking our MDE files to allow only licensed access? We simply want to allow the user to install the program and get a
13
1995
by: Andy Chau | last post by:
I try to use RSA to implement the following scheme but wasn't sucessful. Sever encrypt a message using a public key, the client decrpyt the message using a private key. I don't want the client to be able to encrypt a message. However, using the Crypto API I need to pass in both the private and public key pairs in order to decrypt the message. When the client has both private and public key, it can just use the public
2
1659
by: Leandro H. Delamare | last post by:
Hello group. I'm with a problem a few days with Smart Cards I Have an C++ DLL with some funcions to read a Smart Card. But the problem is, I have the declarations in C++ and a Program Example in Delphi. I want to make this program with C# How I Can Import and use the DLL Funcions in My C# Program. Some functions is working OK, but I have a function called EAG_GetCardCredits doesn't work.
1
1701
by: Saper\(ek\) | last post by:
I need to encrypt some data in my program, so I've created 2 functions to encrypt and decrypt data. I've created a simple program to test it, and... it crashes. It wors ok on XP, but on win98 it generates an exception (padding is invalid and cannot be removed) When I change coding of chars from Unicode, to utf8 or 7, it does not work even under XP. what can I do, for it to work on XP and win98?? this is the program
2
1055
by: ThunderMusic | last post by:
Hi, I encrypted a string using the RijndaelManaged class. When decrypted, it happens that the string is longer then the original, but the exceeding chars are nothing (string.chars(indexOfExceedingChars) is nothing) To correct the problem, I used SomeOtherStringVar = trim(DecryptedString) The problem is the following: Trim(DecryptedString) returns the string
5
4173
by: ~~~ .NET Ed ~~~ | last post by:
Anybody has any idea why this simple thing is not working? I pass a text file as input to encrypt it, then pass the encrypted version to the same function and get some garbled data not at all resembling the input file. Rijndael rijndaelAlg = Rijndael.Create(); rijndaelAlg.BlockSize = 128; // 128 bits to comply with AES rijndaelAlg.Padding = PaddingMode.PKCS7;
2
24091
by: rayoflight | last post by:
This is how my test program works. Server will encrypt some text and sends it over to the client. The client will then decrypts it. However I have some problem decrypting it. When I play around with the key and the plaintext, sometime it is able to decrypt. I think it should be some ASCII character problems. Right now, I am using out.writeUTF(new String(encrypted)); and on this other side I use in.readUTF() to get the string. Lastly,...
0
8352
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8579
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2699
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1587
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.