An apparatus adapted to improve security against side-channel attacks, comprising: a processor configured to execute: a seed value generator configured to generate a seed value; a divider configured to divide the seed value into a plurality of blocks; a first extractor configured to extract a plurality of first parameter values from a first parameter candidate value set comprising a plurality of first parameter candidate values, each of the plurality of first parameter values respectively corresponding to one of the plurality of blocks divided from the seed value; a second extractor configured to extract a plurality of second parameter values from a second parameter candidate value set comprising a plurality of second parameter candidate values generated based on the plurality of first parameter candidate values included in the first parameter candidate value set, each of the plurality of second parameter values respectively corresponding to one of the plurality of blocks divided from the seed value, wherein at least one of the second parameter candidate values included in the second parameter candidate value set includes a value resulting from multiplying one of the plurality of first parameter candidate values by a secret key; and a calculator configured to generate a first random number based on the plurality of first parameter values, generate a second random number by performing an exponentiation operation based on the first random number as an exponent or performing a scalar multiplication operation of a point based on the first random number as a scalar multiplier, and generate a third random number based on the plurality of second parameter values, wherein the processor is further configured to encrypt data or generate a digital signature for the data based on the first random number, the second random number, and the third random number. a processor configured to execute: a seed value generator configured to generate a seed value; a divider configured to divide the seed value into a plurality of blocks; a first extractor configured to extract a plurality of first parameter values from a first parameter candidate value set comprising a plurality of first parameter candidate values, each of the plurality of first parameter values respectively corresponding to one of the plurality of blocks divided from the seed value; a second extractor configured to extract a plurality of second parameter values from a second parameter candidate value set comprising a plurality of second parameter candidate values generated based on the plurality of first parameter candidate values included in the first parameter candidate value set, each of the plurality of second parameter values respectively corresponding to one of the plurality of blocks divided from the seed value, wherein at least one of the second parameter candidate values included in the second parameter candidate value set includes a value resulting from multiplying one of the plurality of first parameter candidate values by a secret key; and a calculator configured to generate a first random number based on the plurality of first parameter values, generate a second random number by performing an exponentiation operation based on the first random number as an exponent or performing a scalar multiplication operation of a point based on the first random number as a scalar multiplier, and generate a third random number based on the plurality of second parameter values, a seed value generator configured to generate a seed value; a divider configured to divide the seed value into a plurality of blocks; a first extractor configured to extract a plurality of first parameter values from a first parameter candidate value set comprising a plurality of first parameter candidate values, each of the plurality of first parameter values respectively corresponding to one of the plurality of blocks divided from the seed value; a second extractor configured to extract a plurality of second parameter values from a second parameter candidate value set comprising a plurality of second parameter candidate values generated based on the plurality of first parameter candidate values included in the first parameter candidate value set, each of the plurality of second parameter values respectively corresponding to one of the plurality of blocks divided from the seed value, wherein at least one of the second parameter candidate values included in the second parameter candidate value set includes a value resulting from multiplying one of the plurality of first parameter candidate values by a secret key; and a calculator configured to generate a first random number based on the plurality of first parameter values, generate a second random number by performing an exponentiation operation based on the first random number as an exponent or performing a scalar multiplication operation of a point based on the first random number as a scalar multiplier, and generate a third random number based on the plurality of second parameter values, wherein the processor is further configured to encrypt data or generate a digital signature for the data based on the first random number, the second random number, and the third random number.