VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3855
   ClientLeft      =   60
   ClientTop       =   420
   ClientWidth     =   9225
   LinkTopic       =   "Form1"
   ScaleHeight     =   3855
   ScaleWidth      =   9225
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1 
      Caption         =   "dec"
      Height          =   360
      Left            =   7080
      TabIndex        =   7
      Top             =   2880
      Width           =   1935
   End
   Begin MSComDlg.CommonDialog CD 
      Left            =   4440
      Top             =   2040
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CommandButton btnf 
      Caption         =   "File"
      Height          =   375
      Left            =   4200
      TabIndex        =   6
      Top             =   3360
      Width           =   615
   End
   Begin VB.CommandButton btnfile 
      Caption         =   "Enc file"
      Height          =   375
      Left            =   5040
      TabIndex        =   5
      Top             =   3360
      Width           =   3975
   End
   Begin VB.TextBox txtfile 
      Height          =   375
      Left            =   120
      TabIndex        =   4
      Text            =   "txtfile"
      Top             =   3360
      Width           =   3975
   End
   Begin VB.CommandButton btn2 
      Caption         =   "<>"
      Height          =   495
      Left            =   4200
      TabIndex        =   3
      Top             =   1200
      Width           =   735
   End
   Begin VB.CommandButton btn1 
      Caption         =   "enc"
      Height          =   375
      Left            =   5040
      TabIndex        =   2
      Top             =   2880
      Width           =   1935
   End
   Begin VB.TextBox txt2 
      BeginProperty Font 
         Name            =   "MS UI Gothic"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2535
      Left            =   5040
      MultiLine       =   -1  'True
      TabIndex        =   1
      Top             =   240
      Width           =   3975
   End
   Begin VB.TextBox txt1 
      BeginProperty Font 
         Name            =   "MS UI Gothic"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2535
      Left            =   120
      MultiLine       =   -1  'True
      TabIndex        =   0
      Text            =   "Form1.frx":0000
      Top             =   240
      Width           =   3975
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Function ansiencript(source As String) As String
    Dim buffer As String
    Dim tam As Long
    Dim i As Long
    tam = Len(source)
    For i = 1 To tam
        buffer = buffer & Chr$(Asc(Mid$(source, i, 1)) + 3)
    Next
    ansiencript = buffer

End Function

Public Function ansidecript(source As String) As String
    Dim buffer As String
    Dim tam As Long
    Dim i As Long
    tam = Len(source)
    For i = 1 To tam
        buffer = buffer & Chr$(Asc(Mid$(source, i, 1)) - 3)
    Next
    ansidecript = buffer

End Function
Private Sub btn1_Click()
    txt2.Text = ansiencript(txt1.Text)
End Sub

Private Sub btn2_Click()
    txt1.Text = txt2.Text
    txt2.Text = ""
End Sub

Private Sub btnf_Click()
    CD.ShowOpen
    txtfile.Text = CD.FileName
End Sub

Private Sub btnfile_Click()
    Dim archivo() As Byte
    Dim todo As String
    Open txtfile.Text For Binary As #1
        ReDim archivo(LOF(1))
        Get #1, , archivo
    Close #1
    todo = StrConv(archivo, vbUnicode)
    todo = ansiencript(todo)
    CD.ShowSave
    Open CD.FileName For Binary As #2
        Put #2, , todo
    Close #2
    MsgBox "hecho"
End Sub

Private Sub Command1_Click()
txt2.Text = ansidecript(txt1.Text)
End Sub
