A method of securing a software code of an application including at least one constant data, said method generating a secure software code and comprising performed by a processor: for at least one constant data included in the application software code, called current constant data: - fragmenting said current constant data into several valid data chunks of random length, - encoding and storing said valid data chunks at random locations in the application software code, - identifying all occurences of the current constant data in the application software code and replacing each of them with a call to a Runtime application self-protection (RASP) agent for reading the current constant data, said RASP agent being configured for running in the application runtime environment and being capable of controlling application execution and detecting and preventing real-time attacks, - inserting, at random locations of a control flow graph of the application software code, Runtime Application Self-Protection (RASP) check instructions which when executed at runtime: • compute RASP check values, • notify the RASP agent with the computed RASP check values, such that, at runtime, in response to each call to the RASP agent for reading the current constant data: ✔ the RASP agent retrieves, all data chunks, ✔ when no RASP check is violated, the RASP agent decodes and combines all the valid data chunks and returns said current constant data, ✔ and when at least one RASP check is violated, the RASP agent returns a dummy constant data. for at least one constant data included in the application software code, called current constant data: - fragmenting said current constant data into several valid data chunks of random length, - encoding and storing said valid data chunks at random locations in the application software code, - identifying all occurences of the current constant data in the application software code and replacing each of them with a call to a Runtime application self-protection (RASP) agent for reading the current constant data, said RASP agent being configured for running in the application runtime environment and being capable of controlling application execution and detecting and preventing real-time attacks, - inserting, at random locations of a control flow graph of the application software code, Runtime Application Self-Protection (RASP) check instructions which when executed at runtime: • compute RASP check values, • notify the RASP agent with the computed RASP check values, - fragmenting said current constant data into several valid data chunks of random length, - encoding and storing said valid data chunks at random locations in the application software code, - identifying all occurences of the current constant data in the application software code and replacing each of them with a call to a Runtime application self-protection (RASP) agent for reading the current constant data, said RASP agent being configured for running in the application runtime environment and being capable of controlling application execution and detecting and preventing real-time attacks, - inserting, at random locations of a control flow graph of the application software code, Runtime Application Self-Protection (RASP) check instructions which when executed at runtime: • compute RASP check values, • notify the RASP agent with the computed RASP check values, • compute RASP check values, • notify the RASP agent with the computed RASP check values, such that, at runtime, in response to each call to the RASP agent for reading the current constant data: ✔ the RASP agent retrieves, all data chunks, ✔ when no RASP check is violated, the RASP agent decodes and combines all the valid data chunks and returns said current constant data, ✔ and when at least one RASP check is violated, the RASP agent returns a dummy constant data. ✔ the RASP agent retrieves, all data chunks, ✔ when no RASP check is violated, the RASP agent decodes and combines all the valid data chunks and returns said current constant data, ✔ and when at least one RASP check is violated, the RASP agent returns a dummy constant data.