Posts

Showing posts from April, 2021

IBMi (AS400) fans only - RPG Free. Minimalist program with a single video format

Image
  #IBMiSample Remember that you need my CLANA00F file to compile the following program. So, f irst of all look at this post and compile and populate these files to use this example. A01ARPCL.CLP              PGM                                                              DCL        VAR(&PPCCL0) TYPE(*DEC)   LEN(7 0)                    DCL        VAR(&PPEXIT) TYPE(*CHAR)  LEN(1)                      DCL        VAR(&OUTPU1) TYPE(*CHAR)  LEN(1)                      DCL        VAR(&OUTPU7) TYPE(*CHAR)  LEN(7)                      DCL        VAR(&OUTPU8) TYPE(*CHAR)  LEN(8)                      CALL       PGM(A01ARP) PARM(&PPEXIT &PPCCL0)                     CHGVAR     VAR(&OUTPU1) VALUE(&PPEXIT)                           CHGVAR     VAR(&OUTPU7) VALUE(&PPCCL0)                           CHGVAR     VAR(&OUTPU8) VALUE(&OUTPU1 *CAT &OUTPU7)              SNDPGMMSG  MSG(&OUTPU8)                                          ENDPGM         

IBMi (AS400) fans only - How to store passwords in a secure way in a DB2 SQL Server database

Image
#IBMiSample This is a wery simple way to store passwords in a secure way in a DB2 SQL Server database. First of all create a table with only two fileds, user (UTENTE), and password (PWD). CREATE TABLE A01AWPWD (UTENTE varchar(128), PWD VARCHAR(124) FOR BIT DATA) Establish an encryption key. My encryption key for this example is skjdjuiu%Tr&$*+[be%_tr=\? Fill the table with users and passwords: INSERT INTO A01AWPWD (UTENTE, PWD) VALUES ('User01', ENCRYPT('Passw01', 'skjdjuiu%Tr&$*+[be%_tr=\?'))          INSERT INTO A01AWPWD (UTENTE, PWD) VALUES ('User02', ENCRYPT('Passw02', 'skjdjuiu%Tr&$*+[be%_tr=\?')) INSERT INTO A01AWPWD (UTENTE, PWD) VALUES ('JohnS', ENCRYPT('ert%9ii', 'skjdjuiu%Tr&$*+[be%_tr=\?')) Now we have a table A01AWPWD with ENCRYPTED passwords. Try this: SELECT PWD  FROM A01AWPWD  WHERE UTENTE = 'JohnS' As you can see, the password is ENCRYPTED. To read  (DECRYPT) the  passwords y