Encryption

Is it possible to encrypt data to store in adabas
Like password that is stored in plain text

http://natural-adabas.blogspot.com/2006/06/adabas-security_20.html

Going back a few years, but yes, it is possible

Thank You for the info
is there a howto example to use to store the values in a encrypted format

Which platform are you using? Mainframe? LUW?

i am using luw natural for unix

Are you asking if the database can manage the encryption?

Or would you prefer to encrypt the data and then store it in the database?

I wish to encrypt the data and then store it in the database if possible

One option, fairly intensive…

Use openssl to create a key pair (private/public)
Create a script to encrypt
Create a script to decrypt
Create a subprogram to call the encrypt with the text to encrypt
Create a subprogram to call the encrypt with the text to decrypt

Another option - create an internal table and swap value by digit… - not real secure, but better than nothing

Personally, I think you would be better off relying on encryption at rest - via ADASCR and storage utilities

Attached is an example program, subprogram, basic information for my previous instructions

example.txt (3.13 KB)

FYI - For fun, I created a container based on the SoftwareAG Natural CE container that has this example code built in…

https://hub.docker.com/r/niceine/mynat

note: this is a linux container

The password issue is a special kind of thing. I would use a hash-algorithm (maybe with salt, see Salt (cryptography) - Wikipedia )

Natural has an implemented sha1-Hash-Algorhythm.


*
DEFINE DATA LOCAL
1 #INPUT-PARAMETER
  2 #I-STRING (A) DYNAMIC INIT <'The quick brown fox jumps over the lazy dog'>
1 #OUTPUT-PARAMETER
  2 #SHA1-SUM (B20)
LOCAL
1 #FUNC (I4)
1 #B156 (B156)
END-DEFINE
*
#FUNC := 0
CALLNAT 'USR4011N' #FUNC #B156 #I-STRING #OUTPUT-PARAMETER.#SHA1-SUM
write #SHA1-SUM
END

The idea is to store the sha1-sum instead of the Password itself.