nileshsamsonite
9th June 2010, 15:25
Hi,
How to create a text file with encryption? The file line characters may exceed than 255 char.

Thanks
Nilesh

NPRao
10th June 2010, 21:39
Nilesh,

You can use the Unix crypt command:

crypt(1) crypt(1)

NAME
crypt - encode/decode files

SYNOPSIS
crypt [password]

DESCRIPTION
crypt reads from the standard input and writes on the standard output. password is a key that selects a particular transformation. If no password is given, crypt demands a key from the terminal and turns off printing while the key is being typed in. crypt encrypts and decrypts with the same key:

crypt key <clear >cypher
crypt key <cypher|pr
For Windows refer to -Encrypt your data with Windows XP Professional (http://www.microsoft.com/windowsxp/using/security/learnmore/encryptdata.mspx)

nileshsamsonite
11th June 2010, 11:38
Dear NPRao,

Thanks for your information.
Actually , We want to generate a text file from BaaN report session. Due to the limitation of report layout of 255 characters we need to create a file. In addition to this I want this file to get encrypted while creating.

Thanks
Nilesh

NPRao
11th June 2010, 18:53
Due to the limitation of report layout of 255 characters we need to create a file.
Nilesh,

Please use search for already discussed threads. Refer to the thread -
Exclamation Nb max of caracters on line in the report (http://www.baanboard.com/baanboard/showthread.php?t=9408&highlight=spool)
In addition to this I want this file to get encrypted while creating.
Please explain what is the purpose of encrypting during file creation?
Crypt command needs an input file. One possible option is to use - seq.open() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_directory_file_operations_seq_open) with binary mode.

nileshsamsonite
17th June 2010, 12:16
Dear NPRao,

We are generating a text file of composed payment. This file is having information of cheques with amount. This file is uploaded to the bank's portal site. Then the cheques gets printed in Bank and then disbursed to the supplier. Therefore before uploading / rather while generating the file we would like to encrypt the information ( like amount, cheque no .. everything) . This we want to do for the sake of security. No one will update the contents of the file.
Pl help how to generate such file through BaaN session.

Thanks

Nilesh

Hitesh Shah
17th June 2010, 19:26
In case u dont find any encryption function , u can write ur own custom function to encrypt and decrypt whenever required . That will require some detailed efforts.

NPRao
21st June 2010, 23:23
We are generating a text file of composed payment. This file is having information of cheques with amount. This file is uploaded to the bank's portal site. Then the cheques gets printed in Bank and then disbursed to the supplier. Therefore before uploading / rather while generating the file we would like to encrypt the information ( like amount, cheque no .. everything) . This we want to do for the sake of security. No one will update the contents of the file.
Couple of thoughts -
1. Which OS are you on?
2. You can use file access permission and set to rwx------ so others cannot read/write/view the file and only the file owner has all the permissions.
3. The crypt() on Unix operates at file level. Here is example usage -
[DEV:bsp]/app/common/home/bsp/test>cat input.file
Hello World
[DEV:bsp]/app/common/home/bsp/test>crypt testing < input.file > output.file
[DEV:bsp]/app/common/home/bsp/test>cat output.file
ö¯4ªÚÃGîH
[DEV:bsp]/app/common/home/bsp/test>crypt testing < output.file
Hello World
4. No one can read the contents of the file, until its saved or closed by your process.