home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / encdec / encdec.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-10-06  |  5.8 KB  |  214 lines

  1. VERSION 5.00
  2. Begin VB.Form encdec 
  3.    Caption         =   "Developed by Nikki - Encryption/decryption"
  4.    ClientHeight    =   3195
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4980
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   3195
  10.    ScaleWidth      =   4980
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton Command3 
  13.       Caption         =   "End"
  14.       Height          =   825
  15.       Left            =   2070
  16.       Picture         =   "encdec.frx":0000
  17.       Style           =   1  'Graphical
  18.       TabIndex        =   13
  19.       Top             =   2280
  20.       Width           =   945
  21.    End
  22.    Begin VB.CommandButton Command2 
  23.       Caption         =   "Decrypt value in Box 3."
  24.       Height          =   465
  25.       Left            =   3180
  26.       TabIndex        =   5
  27.       Top             =   2520
  28.       Width           =   1185
  29.    End
  30.    Begin VB.TextBox decr 
  31.       Height          =   285
  32.       Left            =   2880
  33.       TabIndex        =   4
  34.       Top             =   450
  35.       Width           =   1605
  36.    End
  37.    Begin VB.TextBox svd 
  38.       Height          =   465
  39.       Left            =   1110
  40.       TabIndex        =   2
  41.       Top             =   1620
  42.       Width           =   2535
  43.    End
  44.    Begin VB.CommandButton Command1 
  45.       Caption         =   "Encrypt value in Box 1."
  46.       Height          =   435
  47.       Left            =   330
  48.       TabIndex        =   1
  49.       Top             =   2550
  50.       Width           =   1425
  51.    End
  52.    Begin VB.TextBox pwd 
  53.       Height          =   315
  54.       Left            =   360
  55.       TabIndex        =   0
  56.       Top             =   480
  57.       Width           =   1665
  58.    End
  59.    Begin VB.Label Label6 
  60.       Caption         =   "3."
  61.       BeginProperty Font 
  62.          Name            =   "MS Sans Serif"
  63.          Size            =   8.25
  64.          Charset         =   0
  65.          Weight          =   700
  66.          Underline       =   0   'False
  67.          Italic          =   0   'False
  68.          Strikethrough   =   0   'False
  69.       EndProperty
  70.       Height          =   495
  71.       Left            =   450
  72.       TabIndex        =   12
  73.       Top             =   1650
  74.       Width           =   375
  75.    End
  76.    Begin VB.Label Label5 
  77.       Caption         =   "2."
  78.       BeginProperty Font 
  79.          Name            =   "MS Sans Serif"
  80.          Size            =   8.25
  81.          Charset         =   0
  82.          Weight          =   700
  83.          Underline       =   0   'False
  84.          Italic          =   0   'False
  85.          Strikethrough   =   0   'False
  86.       EndProperty
  87.       Height          =   405
  88.       Left            =   2490
  89.       TabIndex        =   11
  90.       Top             =   420
  91.       Width           =   315
  92.    End
  93.    Begin VB.Label Label4 
  94.       Caption         =   "1."
  95.       BeginProperty Font 
  96.          Name            =   "MS Sans Serif"
  97.          Size            =   8.25
  98.          Charset         =   0
  99.          Weight          =   700
  100.          Underline       =   0   'False
  101.          Italic          =   0   'False
  102.          Strikethrough   =   0   'False
  103.       EndProperty
  104.       Height          =   285
  105.       Left            =   30
  106.       TabIndex        =   10
  107.       Top             =   540
  108.       Width           =   285
  109.    End
  110.    Begin VB.Label Label3 
  111.       Caption         =   "Decrypting encrypted string"
  112.       Height          =   645
  113.       Left            =   3870
  114.       TabIndex        =   9
  115.       Top             =   1440
  116.       Width           =   885
  117.    End
  118.    Begin VB.Label Label2 
  119.       Caption         =   "Value obtained after performing algorithm"
  120.       Height          =   495
  121.       Left            =   150
  122.       TabIndex        =   8
  123.       Top             =   1140
  124.       Width           =   1845
  125.    End
  126.    Begin VB.Line Line3 
  127.       X1              =   4080
  128.       X2              =   4140
  129.       Y1              =   1050
  130.       Y2              =   1230
  131.    End
  132.    Begin VB.Line Line2 
  133.       X1              =   3900
  134.       X2              =   4050
  135.       Y1              =   1050
  136.       Y2              =   1020
  137.    End
  138.    Begin VB.Line Line1 
  139.       X1              =   3750
  140.       X2              =   4080
  141.       Y1              =   1620
  142.       Y2              =   990
  143.    End
  144.    Begin VB.Label b 
  145.       Height          =   285
  146.       Left            =   3150
  147.       TabIndex        =   7
  148.       Top             =   840
  149.       Width           =   945
  150.    End
  151.    Begin VB.Label a 
  152.       Height          =   315
  153.       Left            =   420
  154.       TabIndex        =   6
  155.       Top             =   900
  156.       Width           =   855
  157.    End
  158.    Begin VB.Label Label1 
  159.       Caption         =   "Enter a string to encrypted"
  160.       Height          =   195
  161.       Left            =   60
  162.       TabIndex        =   3
  163.       Top             =   150
  164.       Width           =   1935
  165.    End
  166. Attribute VB_Name = "encdec"
  167. Attribute VB_GlobalNameSpace = False
  168. Attribute VB_Creatable = False
  169. Attribute VB_PredeclaredId = True
  170. Attribute VB_Exposed = False
  171. Private Sub Command1_Click()
  172. encrypwd
  173. End Sub
  174. Private Sub encrypwd()
  175. Dim ori As String
  176. Dim plen As Integer
  177. Dim i As Integer
  178. Dim tchg As String
  179. Dim fchg As String
  180. Dim asval As Integer
  181. ori = pwd.Text
  182. plen = Len(ori)
  183. i = 1
  184. fchg = ""
  185. While Not i > plen
  186. tchg = Mid(ori, i, 1)
  187. asval = (Asc(tchg) + 4) * 2 - 4
  188. fchg = fchg + Chr(asval)
  189. i = i + 1
  190. a.Caption = asval
  191. svd.Text = fchg
  192. End Sub
  193. Private Sub decrypwd()
  194. Dim tchg As String
  195. Dim fchg As String
  196. Dim plen As Integer
  197. Dim i As Integer
  198. Dim asval As Integer
  199. i = 1
  200. plen = Len(svd.Text)
  201. While Not i > plen
  202. tchg = Mid(svd.Text, i, 1)
  203. asval = (Asc(tchg) + 4) / 2 - 4
  204. fchg = fchg + Chr(asval)
  205. i = i + 1
  206. b.Caption = asval
  207. decr.Text = fchg
  208. End Sub
  209. Private Sub Command2_Click()
  210. decrypwd
  211. End Sub
  212. Private Sub Command3_Click()
  213. End Sub
  214.