0% found this document useful (0 votes)
8 views1 page

Problem Description

The document describes a data encryption process where a key value is added to the ASCII value of each character in a given string. It outlines an algorithm for encrypting the data string based on the provided key and specifies the input and output format. The constraints ensure that the data string length is manageable and that the key value is within a specified range.

Uploaded by

ivai8671
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Problem Description

The document describes a data encryption process where a key value is added to the ASCII value of each character in a given string. It outlines an algorithm for encrypting the data string based on the provided key and specifies the input and output format. The constraints ensure that the data string length is manageable and that the key value is within a specified range.

Uploaded by

ivai8671
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

A company provides data encryption to its client data.

The data sent over the


network is in the form of a string. The encryption Algorithm used by the company
adds a key value in the ascii value of each character of the data string and forms
the encrypted string. This string is then sent over the network to provide security

Write an algorithm to find the encrypted data string

Input
The first line of the input consists of an integer - key, representing the key
value for the encryption
The second line consists of a string - dataStr, representing the data String to be
encrypted

Output
Print a string representing the encrypted data string

Constraints
0 < len <= 1000, len is the length of the given data string dataStr
0 <= key <= 100

Note
The dataStr can contain lowercase and uppercase English letters (i.e a-z, A-Z)
digits (i.e 0-9), and any special symbols

Example
Input
3
as3gAsd

Output
dv7jDvg

Explanation
After adding 3 in the ascii value of the characters in the data string, the
encrypted string becomes dv7jDvg

You might also like