An information processing apparatus that generates private information used as one of an encryption key for encrypting data or a generation key for generating falsification detection information used in detecting falsification of data, comprises a storage unit adapted to prestore key information, an input unit adapted to input calculation target information, a calculating unit adapted to perform a calculation on targeted information based on the key information held in the storage unit, a detecting unit adapted to detect a predetermined event, and a control unit adapted, when triggered by detection of the event by the detecting unit, to perform controls to generate the private information by making the calculating unit perform the calculation with the input calculation target information as the targeted information, and to place the key information stored in the storage unit in an unusable state.