该程序是否正确包含在vernam程序XOR中? [英] Whether the program is properly included vernam program XOR ?

查看:58
本文介绍了该程序是否正确包含在vernam程序XOR中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

      Me.enkripsib.Text = "Enkripsi"
      Me.dekripsir.Text = "Dekripsi"
  End Sub

Private Function vernamr(ByVal orig As String, ByVal key As String)
       Dim ret As String = String.Empty
       For i = 0 To orig.Length - 1
           Dim p As Char
           If key.Length - 1 > i + 1 Then p = key(i)
           ret &= Convert.ToChar(Convert.ToInt32(orig(i)) Xor Convert.ToInt32(p))
       Next
       Return ret
   End Function





我的尝试:



我想知道这包括程序vernam XOR吗?为什么当我使加密理论与该程序的结果不同时(srry bd 3nglish)



What I have tried:

I wonder if this included program vernam XOR? why when I make encryption theory different from the results of this program (srry bd 3nglish)

推荐答案

你应该学会尽快使用调试器。而不是猜测你的代码在做什么,现在是时候看到你的代码执行并确保它完成你期望的。



调试器允许你跟踪执行逐行检查变量,你会看到它有一个停止做你期望的点。

调试器 - 维基百科,免费的百科全书 [ ^ ]

掌握Visual Studio 2010中的调试 - A初学者指南 [ ^ ]



调试器在这里向您展示您的代码正在做什么,您的任务是与它应该做什么进行比较。 />
当代码不做ex的时候你接近了一个bug。



Nota:看起来你已经擅长找到你不理解的坏代码,可能是它是时候开始真正学习了。
You should learn to use the debugger as soon as possible. Rather than guessing what your code is doing, It is time to see your code executing and ensuring that it does what you expect.

The debugger allow you to follow the execution line by line, inspect variables and you will see that there is a point where it stop doing what you expect.
Debugger - Wikipedia, the free encyclopedia[^]
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]

The debugger is here to show you what your code is doing and your task is to compare with what it should do.
When the code don't do what is expected, you are close to a bug.

Nota: It looks like you are already good at finding bad pieces of code that you don't understand, May be it is time to start to study really.


这篇关于该程序是否正确包含在vernam程序XOR中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆