diff --git a/samples/crypto/rsa/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/crypto/rsa/boards/nrf5340dk_nrf5340_cpuapp.conf
index bda352ac17..b27fd79c89 100644
--- a/samples/crypto/rsa/boards/nrf5340dk_nrf5340_cpuapp.conf
+++ b/samples/crypto/rsa/boards/nrf5340dk_nrf5340_cpuapp.conf
@@ -9,4 +9,4 @@ CONFIG_PSA_CRYPTO_DRIVER_CC3XX=n
 
 # Mbedtls configuration
 CONFIG_MBEDTLS_ENABLE_HEAP=y
-CONFIG_MBEDTLS_HEAP_SIZE=16384
+CONFIG_MBEDTLS_HEAP_SIZE=20480
\ No newline at end of file
diff --git a/samples/crypto/rsa/prj.conf b/samples/crypto/rsa/prj.conf
index 8a4f9eec84..39ca509f6d 100644
--- a/samples/crypto/rsa/prj.conf
+++ b/samples/crypto/rsa/prj.conf
@@ -3,26 +3,47 @@
 #
 # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 #
-CONFIG_MAIN_STACK_SIZE=16384
-CONFIG_HEAP_MEM_POOL_SIZE=16384
+CONFIG_MAIN_STACK_SIZE=20480
+CONFIG_HEAP_MEM_POOL_SIZE=20480
 
 # Enable logging
 CONFIG_CONSOLE=y
 CONFIG_LOG=y
 CONFIG_LOG_MODE_IMMEDIATE=y
 
+# 로깅 Config 종료
+
+# Config Clock Control 시작
+CONFIG_SOC_ENABLE_LFXO=n
+
+CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
+
+CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
+
+CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
+# Config Clock Control 종료
+
 # Enable nordic security backend and PSA APIs
 CONFIG_NRF_SECURITY=y
 CONFIG_MBEDTLS_PSA_CRYPTO_C=y
+CONFIG_PSA_WANT_GENERATE_RANDOM=y
+
+# CONFIG_PSA_USE_CC3XX_KEY_MANAGEMENT_DRIVER=y
 
 CONFIG_PSA_WANT_ALG_RSA_PKCS1V15_SIGN=y
 CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT=y
 CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT=y
 CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE=y
 CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE=y
+
 CONFIG_PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY=y
 
+# CONFIG_PSA_USE_CC3XX_ASYMMETRIC_ENCRYPTION_DRIVER=y
+CONFIG_PSA_WANT_ALG_RSA_OAEP=y
+
+# CONFIG_PSA_USE_CC3XX_HASH_DRIVER=y
 CONFIG_PSA_WANT_ALG_SHA_256=y
 
 # This samples source code explicitly uses an RSA key size of 4096
-CONFIG_PSA_WANT_RSA_KEY_SIZE_4096=y
+# CONFIG_PSA_WANT_RSA_KEY_SIZE_4096=n
+CONFIG_PSA_WANT_RSA_KEY_SIZE_2048=y
diff --git a/samples/crypto/rsa/src/key.h b/samples/crypto/rsa/src/key.h
index 96b95b6a4a..5a8be3eae1 100644
--- a/samples/crypto/rsa/src/key.h
+++ b/samples/crypto/rsa/src/key.h
@@ -166,7 +166,7 @@ const unsigned char private_key_der[] = {
 	0xc5, 0xef, 0x9d, 0xe5, 0x7d, 0x40, 0xef, 0xe0, 0xe9, 0x07, 0x6c, 0x6f, 0xf6, 0xe9, 0x23,
 	0xb5, 0xf1, 0x85, 0x87, 0x5e, 0x9e, 0x5b, 0xae, 0x8d, 0x29, 0x8d, 0xf6, 0x17, 0x83, 0x91,
 	0x16, 0x12, 0xcb, 0x6b, 0x6c, 0x13, 0x12, 0xda};
-
+#if 0
 const unsigned char public_key_der[] = {
 	0x30, 0x82, 0x02, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
 	0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x02, 0x0f, 0x00, 0x30, 0x82, 0x02, 0x0a, 0x02, 0x82,
@@ -205,3 +205,25 @@ const unsigned char public_key_der[] = {
 	0x01, 0x67, 0xce, 0x97, 0x61, 0xf4, 0xff, 0x64, 0x4a, 0xf0, 0x1a, 0xf7, 0x14, 0xf9, 0x71,
 	0x97, 0xc6, 0x07, 0x91, 0xe9, 0xbd, 0xf0, 0xa0, 0x3c, 0xc3, 0x7b, 0x91, 0xb0, 0x36, 0x10,
 	0x3a, 0xc9, 0x65, 0x97, 0x17, 0x02, 0x03, 0x01, 0x00, 0x01};
+#else
+const unsigned char public_key_der[] = {
+	0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xa2, 0xb4, 0x51, 0xa0, 0x7d, 0x0a,
+	0xa5, 0xf9, 0x6e, 0x45, 0x56, 0x71, 0x51, 0x35, 0x50, 0x51, 0x4a, 0x8a, 0x5b, 0x46, 0x2e,
+	0xbe, 0xf7, 0x17, 0x09, 0x4f, 0xa1, 0xfe, 0xe8, 0x22, 0x24, 0xe6, 0x37, 0xf9, 0x74, 0x6d,
+	0x3f, 0x7c, 0xaf, 0xd3, 0x18, 0x78, 0xd8, 0x03, 0x25, 0xb6, 0xef, 0x5a, 0x17, 0x00, 0xf6,
+	0x59, 0x03, 0xb4, 0x69, 0x42, 0x9e, 0x89, 0xd6, 0xea, 0xc8, 0x84, 0x50, 0x97, 0xb5, 0xab,
+	0x39, 0x31, 0x89, 0xdb, 0x92, 0x51, 0x2e, 0xd8, 0xa7, 0x71, 0x1a, 0x12, 0x53, 0xfa, 0xcd,
+	0x20, 0xf7, 0x9c, 0x15, 0xe8, 0x24, 0x7f, 0x3d, 0x3e, 0x42, 0xe4, 0x6e, 0x48, 0xc9, 0x8e,
+	0x25, 0x4a, 0x2f, 0xe9, 0x76, 0x53, 0x13, 0xa0, 0x3e, 0xff, 0x8f, 0x17, 0xe1, 0xa0, 0x29,
+	0x39, 0x7a, 0x1f, 0xa2, 0x6a, 0x8d, 0xce, 0x26, 0xf4, 0x90, 0xed, 0x81, 0x29, 0x96, 0x15,
+	0xd9, 0x81, 0x4c, 0x22, 0xda, 0x61, 0x04, 0x28, 0xe0, 0x9c, 0x7d, 0x96, 0x58, 0x59, 0x42,
+	0x66, 0xf5, 0xc0, 0x21, 0xd0, 0xfc, 0xec, 0xa0, 0x8d, 0x94, 0x5a, 0x12, 0xbe, 0x82, 0xde,
+	0x4d, 0x1e, 0xce, 0x6b, 0x4c, 0x03, 0x14, 0x5b, 0x5d, 0x34, 0x95, 0xd4, 0xed, 0x54, 0x11,
+	0xeb, 0x87, 0x8d, 0xaf, 0x05, 0xfd, 0x7a, 0xfc, 0x3e, 0x09, 0xad, 0xa0, 0xf1, 0x12, 0x64,
+	0x22, 0xf5, 0x90, 0x97, 0x5a, 0x19, 0x69, 0x81, 0x6f, 0x48, 0x69, 0x8b, 0xcb, 0xba, 0x1b,
+	0x4d, 0x9c, 0xae, 0x79, 0xd4, 0x60, 0xd8, 0xf9, 0xf8, 0x5e, 0x79, 0x75, 0x00, 0x5d, 0x9b,
+	0xc2, 0x2c, 0x4e, 0x5a, 0xc0, 0xf7, 0xc1, 0xa4, 0x5d, 0x12, 0x56, 0x9a, 0x62, 0x80, 0x7d,
+	0x3b, 0x9a, 0x02, 0xe5, 0xa5, 0x30, 0xe7, 0x73, 0x06, 0x6f, 0x45, 0x3d, 0x1f, 0x5b, 0x4c,
+	0x2e, 0x9c, 0xf7, 0x82, 0x02, 0x83, 0xf7, 0x42, 0xb9, 0xd5, 0x02, 0x03, 0x01, 0x00, 0x01
+       };
+#endif
\ No newline at end of file
diff --git a/samples/crypto/rsa/src/main.c b/samples/crypto/rsa/src/main.c
index 3fca48fe52..23b0e2316b 100644
--- a/samples/crypto/rsa/src/main.c
+++ b/samples/crypto/rsa/src/main.c
@@ -4,244 +4,293 @@
  * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
  */
 
-#include <zephyr/kernel.h>
-#include <zephyr/sys/printk.h>
-#include <zephyr/logging/log.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <psa/crypto.h>
-#include <psa/crypto_extra.h>
-
-#include "key.h"
-
-#ifdef CONFIG_BUILD_WITH_TFM
-#include <tfm_ns_interface.h>
-#endif
-
-#define APP_SUCCESS	    (0)
-#define APP_ERROR	    (-1)
-#define APP_SUCCESS_MESSAGE "Example finished successfully!"
-#define APP_ERROR_MESSAGE   "Example exited with error!"
-
-#define PRINT_HEX(p_label, p_text, len)                                                            \
-	({                                                                                         \
-		LOG_INF("---- %s (len: %u): ----", p_label, len);                                  \
-		LOG_HEXDUMP_INF(p_text, len, "Content:");                                          \
-		LOG_INF("---- %s end  ----", p_label);                                             \
-	})
-
-LOG_MODULE_REGISTER(rsa, LOG_LEVEL_DBG);
-
-/* ====================================================================== */
-/*				Global variables/defines for the RSA example			  */
-
-#ifndef CONFIG_PSA_WANT_RSA_KEY_SIZE_4096
-#error "This sample needs a key size of 4096"
-#endif
-
-#define NRF_CRYPTO_EXAMPLE_RSA_TEXT_SIZE       (100)
-#define NRF_CRYPTO_EXAMPLE_RSA_PUBLIC_KEY_SIZE (PSA_KEY_EXPORT_RSA_PUBLIC_KEY_MAX_SIZE(4096))
-#define NRF_CRYPTO_EXAMPLE_RSA_SIGNATURE_SIZE  (PSA_BITS_TO_BYTES(4096))
-
-/* Below text is used as plaintext for signing using RSA . */
-static char m_plain_text[NRF_CRYPTO_EXAMPLE_RSA_TEXT_SIZE] = {
-	"Example string to demonstrate basic usage of RSA."};
-
-static char m_signature[NRF_CRYPTO_EXAMPLE_RSA_SIGNATURE_SIZE];
-static char m_hash[32];
-
-static psa_key_id_t keypair_handle;
-static psa_key_id_t pub_key_handle;
-/* ====================================================================== */
-
-int crypto_init(void)
-{
-	psa_status_t status;
-
-	/* Initialize PSA Crypto */
-	status = psa_crypto_init();
-	if (status != PSA_SUCCESS) {
-		return APP_ERROR;
-	}
-
-	return APP_SUCCESS;
-}
-
-int crypto_finish(void)
-{
-	psa_status_t status;
-
-	/* Destroy the key handle */
-	status = psa_destroy_key(keypair_handle);
-	if (status != PSA_SUCCESS) {
-		LOG_INF("psa_destroy_key failed! (Error: %d)", status);
-		return APP_ERROR;
-	}
-
-	status = psa_destroy_key(pub_key_handle);
-	if (status != PSA_SUCCESS) {
-		LOG_INF("psa_destroy_key failed! (Error: %d)", status);
-		return APP_ERROR;
-	}
-
-	return APP_SUCCESS;
-}
-
-int import_rsa_keypair(void)
-{
-	psa_status_t status;
-
-	LOG_INF("Importing RSA keypair...");
-
-	/* Configure the key attributes */
-	psa_key_attributes_t key_attributes = PSA_KEY_ATTRIBUTES_INIT;
-
-	/* Configure the key attributes */
-	psa_set_key_usage_flags(&key_attributes, PSA_KEY_USAGE_SIGN_HASH);
-	psa_set_key_lifetime(&key_attributes, PSA_KEY_LIFETIME_VOLATILE);
-	psa_set_key_algorithm(&key_attributes, PSA_ALG_RSA_PKCS1V15_SIGN(PSA_ALG_SHA_256));
-	psa_set_key_type(&key_attributes, PSA_KEY_TYPE_RSA_KEY_PAIR);
-	psa_set_key_bits(&key_attributes, 4096);
-
-	/* Generate a random keypair. The keypair is not exposed to the application,
-	 * we can use it to signing/verification the key handle.
-	 */
-	status = psa_import_key(&key_attributes, private_key_der, sizeof(private_key_der),
-				&keypair_handle);
-	if (status != PSA_SUCCESS) {
-		LOG_INF("psa_import_key failed! (Error: %d)", status);
-		return APP_ERROR;
-	}
-
-	/* After the key handle is acquired the attributes are not needed */
-	psa_reset_key_attributes(&key_attributes);
-
-	LOG_INF("RSA private key imported successfully!");
-
-	return APP_SUCCESS;
-}
-
-int import_rsa_pub_key(void)
-{
-	/* Configure the key attributes */
-	psa_key_attributes_t key_attributes = PSA_KEY_ATTRIBUTES_INIT;
-	psa_status_t status;
-
-	/* Configure the key attributes */
-	psa_set_key_usage_flags(&key_attributes, PSA_KEY_USAGE_VERIFY_HASH);
-	psa_set_key_lifetime(&key_attributes, PSA_KEY_LIFETIME_VOLATILE);
-	psa_set_key_algorithm(&key_attributes, PSA_ALG_RSA_PKCS1V15_SIGN(PSA_ALG_SHA_256));
-	psa_set_key_type(&key_attributes, PSA_KEY_TYPE_RSA_PUBLIC_KEY);
-	psa_set_key_bits(&key_attributes, 4096);
-
-	status = psa_import_key(&key_attributes, public_key_der, sizeof(public_key_der),
-				&pub_key_handle);
-	if (status != PSA_SUCCESS) {
-		LOG_INF("psa_import_key failed! (Error: %d)", status);
-		return APP_ERROR;
-	}
-
-	/* After the key handle is acquired the attributes are not needed */
-	psa_reset_key_attributes(&key_attributes);
-
-	LOG_INF("RSA public key imported successfully!");
-
-	return APP_SUCCESS;
-}
-
-int sign_message_rsa(void)
-{
-	uint32_t olen;
-	psa_status_t status;
-
-	LOG_INF("Signing a message using RSA...");
-
-	/* Compute the SHA256 hash */
-	status = psa_hash_compute(PSA_ALG_SHA_256, m_plain_text, sizeof(m_plain_text), m_hash,
-				  sizeof(m_hash), &olen);
-	if (status != PSA_SUCCESS) {
-		LOG_INF("psa_hash_compute failed! (Error: %d)", status);
-		return APP_ERROR;
-	}
-
-	/* Sign the hash using RSA */
-	status = psa_sign_hash(keypair_handle, PSA_ALG_RSA_PKCS1V15_SIGN(PSA_ALG_SHA_256), m_hash,
-			       sizeof(m_hash), m_signature, sizeof(m_signature), &olen);
-	if (status != PSA_SUCCESS) {
-		LOG_INF("psa_sign_hash failed! (Error: %d)", status);
-		return APP_ERROR;
-	}
-
-	LOG_INF("Signing was successful!");
-	PRINT_HEX("Plaintext", m_plain_text, sizeof(m_plain_text));
-	PRINT_HEX("SHA256 hash", m_hash, sizeof(m_hash));
-	PRINT_HEX("Signature", m_signature, sizeof(m_signature));
-
-	return APP_SUCCESS;
-}
-
-int verify_message_rsa(void)
-{
-	psa_status_t status;
-
-	LOG_INF("Verifying RSA signature...");
-
-	/* Verify the hash */
-	status = psa_verify_hash(pub_key_handle, PSA_ALG_RSA_PKCS1V15_SIGN(PSA_ALG_SHA_256), m_hash,
-				 sizeof(m_hash), m_signature, sizeof(m_signature));
-	if (status != PSA_SUCCESS) {
-		LOG_INF("psa_verify_hash failed! (Error: %d)", status);
-		return APP_ERROR;
-	}
-
-	LOG_INF("Signature verification was successful!");
-
-	return APP_SUCCESS;
-}
-
-int main(void)
-{
-	int status;
-
-	LOG_INF("Starting the RSA example...");
-
-	status = crypto_init();
-	if (status != APP_SUCCESS) {
-		LOG_INF(APP_ERROR_MESSAGE);
-		return APP_ERROR;
-	}
-
-	status = import_rsa_keypair();
-	if (status != APP_SUCCESS) {
-		LOG_INF(APP_ERROR_MESSAGE);
-		return APP_ERROR;
-	}
-
-	status = import_rsa_pub_key();
-	if (status != APP_SUCCESS) {
-		LOG_INF(APP_ERROR_MESSAGE);
-		return APP_ERROR;
-	}
-
-	status = sign_message_rsa();
-	if (status != APP_SUCCESS) {
-		LOG_INF(APP_ERROR_MESSAGE);
-		return APP_ERROR;
-	}
-
-	status = verify_message_rsa();
-	if (status != APP_SUCCESS) {
-		LOG_INF(APP_ERROR_MESSAGE);
-		return APP_ERROR;
-	}
-
-	status = crypto_finish();
-	if (status != APP_SUCCESS) {
-		LOG_INF(APP_ERROR_MESSAGE);
-		return APP_ERROR;
-	}
-
-	LOG_INF(APP_SUCCESS_MESSAGE);
-
-	return APP_SUCCESS;
-}
+ #include <zephyr/kernel.h>
+ #include <zephyr/sys/printk.h>
+ #include <zephyr/logging/log.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <psa/crypto.h>
+ #include <psa/crypto_extra.h>
+ 
+ #include "key.h"
+ 
+ #ifdef CONFIG_BUILD_WITH_TFM
+ #include <tfm_ns_interface.h>
+ #endif
+ 
+ #define APP_SUCCESS	    (0)
+ #define APP_ERROR	    (-1)
+ #define APP_SUCCESS_MESSAGE "Example finished successfully!"
+ #define APP_ERROR_MESSAGE   "Example exited with error!"
+ 
+ #define PRINT_HEX(p_label, p_text, len)                                                            \
+	 ({                                                                                         \
+		 LOG_INF("---- %s (len: %u): ----", p_label, len);                                  \
+		 LOG_HEXDUMP_INF(p_text, len, "Content:");                                          \
+		 LOG_INF("---- %s end  ----", p_label);                                             \
+	 })
+ 
+ LOG_MODULE_REGISTER(rsa, LOG_LEVEL_DBG);
+ 
+ //### ADDED TO SAMPLE - START
+ uint8_t encrypted[294];
+ 
+ /* ====================================================================== */
+ /*				Global variables/defines for the RSA example			  */
+ 
+ // #ifndef CONFIG_PSA_WANT_RSA_KEY_SIZE_4096
+ // #error "This sample needs a key size of 4096"
+ // #endif
+ 
+ #define NRF_CRYPTO_EXAMPLE_RSA_TEXT_SIZE       (100)
+ #define NRF_CRYPTO_EXAMPLE_RSA_PUBLIC_KEY_SIZE (PSA_KEY_EXPORT_RSA_PUBLIC_KEY_MAX_SIZE(2048))
+ #define NRF_CRYPTO_EXAMPLE_RSA_SIGNATURE_SIZE  (PSA_BITS_TO_BYTES(2048))
+ 
+ #define PSA_ALG_RSA_OAEP_EN 1
+ #define PSA_ALG_RSA_PKCS1V15_CRYPT_EN 0
+ 
+ uint8_t key[16]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F};
+ 
+ /* Below text is used as plaintext for signing using RSA . */
+ static char m_plain_text[NRF_CRYPTO_EXAMPLE_RSA_TEXT_SIZE] = {
+	 "Example string to demonstrate basic usage of RSA."};
+ 
+ static char m_signature[NRF_CRYPTO_EXAMPLE_RSA_SIGNATURE_SIZE];
+ static char m_hash[32];
+ 
+ static psa_key_id_t keypair_handle;
+ static psa_key_id_t pub_key_handle;
+ /* ====================================================================== */
+ 
+ int crypto_init(void)
+ {
+	 psa_status_t status;
+ 
+	 /* Initialize PSA Crypto */
+	 status = psa_crypto_init();
+	 if (status != PSA_SUCCESS) {
+		 return APP_ERROR;
+	 }
+ 
+	 return APP_SUCCESS;
+ }
+ 
+ int import_rsa_pub_key(void)
+ {
+     /* 기존 키가 있다면 삭제 */
+     if (pub_key_handle != 0) {
+	 psa_destroy_key(pub_key_handle);
+	 pub_key_handle = 0;
+     }
+ 
+     /* Configure the key attributes */
+     psa_key_attributes_t key_attributes = PSA_KEY_ATTRIBUTES_INIT;
+     psa_status_t status;
+ 
+     /* ✅ PSA_KEY_USAGE_ENCRYPT 강제 적용 */
+     psa_key_usage_t usage_flags = PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_VERIFY_MESSAGE | PSA_KEY_USAGE_EXPORT;
+     psa_set_key_usage_flags(&key_attributes, usage_flags);
+     psa_set_key_lifetime(&key_attributes, PSA_KEY_LIFETIME_VOLATILE);
+ 
+ #if PSA_ALG_RSA_PKCS1V15_CRYPT_EN
+	 psa_set_key_algorithm(&key_attributes, PSA_ALG_RSA_PKCS1V15_CRYPT);
+ #endif
+ #if PSA_ALG_RSA_OAEP_EN
+	 psa_set_key_algorithm(&key_attributes, PSA_ALG_RSA_OAEP(PSA_ALG_SHA_256));
+ #endif
+ 
+     psa_set_key_type(&key_attributes, PSA_KEY_TYPE_RSA_PUBLIC_KEY);
+     psa_set_key_bits(&key_attributes, 2048);
+ 
+     LOG_INF("Public key length = %d", sizeof(public_key_der));
+ 
+     status = psa_import_key(&key_attributes, public_key_der, sizeof(public_key_der), &pub_key_handle);
+     if (status != PSA_SUCCESS) {
+	 LOG_INF("psa_import_key failed! (Error: %d)", status);
+	 return APP_ERROR;
+     }
+ 
+     return APP_SUCCESS;
+ }
+ 
+ bool rsaEncrypt(uint8_t *plainData, uint16_t plainDataLength, uint8_t *encDataOut, uint16_t *encDataLen)
+ {
+	 psa_status_t status;
+	 uint32_t outputLength = 0;
+	 psa_key_attributes_t key_attr;
+ 
+	 // RSA 키 속성 가져오기
+	 psa_get_key_attributes(pub_key_handle, &key_attr);
+	 size_t rsa_key_size = PSA_BITS_TO_BYTES(psa_get_key_bits(&key_attr));
+ 
+	 // 디버깅 로그 추가
+	 LOG_INF("RSA Key Size (bytes): %d", rsa_key_size);
+	 LOG_INF("Encryption Buffer Size: %d", *encDataLen);
+ 
+	 // 키 크기 확인
+	 if (psa_get_key_bits(&key_attr) < 2048) {
+		 LOG_INF("RSA key size too small! Expected at least 2048 bits.");
+		 return PSA_ERROR_INVALID_ARGUMENT;
+	 }
+ 
+ #if PSA_ALG_RSA_OAEP_EN
+	 /* 🔍 키가 OAEP를 지원하는지 확인 */
+	 psa_algorithm_t key_alg = psa_get_key_algorithm(&key_attr);
+	 LOG_INF("Key Algorithm After Import: 0x%x", key_alg);
+ 
+	 if (key_alg != PSA_ALG_RSA_OAEP(PSA_ALG_SHA_256)) {
+		 LOG_INF("Error: Imported key does not support RSA_OAEP(SHA-256)");
+		 return PSA_ERROR_NOT_SUPPORTED;
+	 }
+ 
+ 
+	 // RSA-OAEP 최대 입력 데이터 크기 계산 (SHA-256 사용)
+	 size_t max_plaintext_size = rsa_key_size - (2 * 32) - 2;
+	 LOG_INF("Max Plaintext Size: %d, Provided Plaintext Size: %d", max_plaintext_size, plainDataLength);
+ 
+	 // 입력 크기 초과 확인
+	 if (plainDataLength > max_plaintext_size) {
+		 LOG_INF("Input data too large for RSA-OAEP!");
+		 return PSA_ERROR_INVALID_ARGUMENT;
+	 }
+ #endif
+ 
+	 // 키 타입 확인
+	 if (psa_get_key_type(&key_attr) != PSA_KEY_TYPE_RSA_PUBLIC_KEY) {
+		 LOG_INF("Incorrect key type! Expected RSA public key.");
+		 return PSA_ERROR_INVALID_ARGUMENT;
+	 }
+ 
+	 // 키 사용 권한 확인
+	 psa_key_usage_t usage_flags = psa_get_key_usage_flags(&key_attr);
+	 if ((usage_flags & PSA_KEY_USAGE_ENCRYPT) == 0) {
+		 LOG_INF("Key does not have encryption usage flag!");
+		 return PSA_ERROR_NOT_PERMITTED;
+	 }
+ 
+	 LOG_INF("Key Type: 0x%x", psa_get_key_type(&key_attr));
+	 LOG_INF("Key Algorithm: 0x%x", psa_get_key_algorithm(&key_attr));
+	 LOG_INF("Key Usage Flags: 0x%x", psa_get_key_usage_flags(&key_attr));
+	 LOG_INF("Key Bits: %d", psa_get_key_bits(&key_attr));
+ 
+ #if PSA_ALG_RSA_OAEP_EN
+	 // Label 길이 문제 해결 → NULL 사용
+	 status = psa_asymmetric_encrypt(pub_key_handle,
+					 PSA_ALG_RSA_OAEP(PSA_ALG_SHA_256),
+					 plainData,
+					 plainDataLength,
+					 NULL,  // Label을 NULL로 설정
+					 0,     // Label 길이를 0으로 설정
+					 encDataOut,
+					 *encDataLen,
+					 &outputLength);
+ #endif
+ 
+ 
+ 
+ #if PSA_ALG_RSA_PKCS1V15_CRYPT_EN
+ 
+	 // Label 길이 문제 해결 → NULL 사용
+	 status = psa_asymmetric_encrypt(pub_key_handle,
+		 PSA_ALG_RSA_PKCS1V15_CRYPT,
+		 plainData,
+		 plainDataLength,
+		 NULL,  // Label을 NULL로 설정
+		 0,     // Label 길이를 0으로 설정
+		 encDataOut,
+		 *encDataLen,
+		 &outputLength);
+ #endif
+ 
+	 if (status != PSA_SUCCESS) {
+		 LOG_INF("Encryption failed! Status: %d", status);
+	 } else {
+		 LOG_INF("Encryption successful! Output Length: %d", outputLength);
+	 }
+ 
+	 PRINT_HEX("Encrypted Data", encDataOut, *encDataLen);
+ 
+	 return status;
+ }
+ 
+ 
+ int testEncryption() {
+     uint8_t encDataOut[256];  // 충분한 크기의 버퍼 할당
+     uint16_t encDataLen = sizeof(encDataOut);  // 버퍼 크기를 설정
+ 
+     int result = rsaEncrypt(key, sizeof(key), encDataOut, &encDataLen);
+     if (!result) {
+	 LOG_INF("Encryption failed: %d\n", result);
+	 return APP_ERROR;
+     }
+	 
+     return APP_SUCCESS;
+ }
+ 
+ int crypto_finish(void)
+ {
+	 psa_status_t status;
+ 
+	 /* Destroy the key handle */
+	 status = psa_destroy_key(keypair_handle);
+	 if (status != PSA_SUCCESS) {
+		 LOG_INF("psa_destroy_key failed! (Error: %d)", status);
+		 return APP_ERROR;
+	 }
+ 
+	 status = psa_destroy_key(pub_key_handle);
+	 if (status != PSA_SUCCESS) {
+		 LOG_INF("psa_destroy_key failed! (Error: %d)", status);
+		 return APP_ERROR;
+	 }
+ 
+	 return APP_SUCCESS;
+ }
+ 
+ int main(void)
+ {
+	 int status;
+ 
+	 LOG_INF("Starting the RSA example...");
+ 
+	 status = crypto_init();
+	 if (status != APP_SUCCESS) {
+		 // LOG_INF(APP_ERROR_MESSAGE);
+		 return APP_ERROR;
+	 }
+	 status = import_rsa_pub_key();
+	 if (status != APP_SUCCESS) {
+		 // LOG_INF(APP_ERROR_MESSAGE);
+		 return APP_ERROR;
+	 }
+ 
+	 status = testEncryption();
+	 if (status != APP_SUCCESS) {
+		 // LOG_INF(APP_ERROR_MESSAGE);
+		 return APP_ERROR;
+	 }
+ 
+	 // k_msleep(1000); 
+ 
+	 // while (1)
+	 // {
+	 // 	for(int i = 0; i < 1; i++)
+	 // 	{
+	 // 		status = testEncryption();
+	 // 		if (status != APP_SUCCESS) {
+	 // 			LOG_INF(APP_ERROR_MESSAGE);
+	 // 			return APP_ERROR;
+	 // 		}
+	 // 	}
+ 
+	 // 	k_msleep(1000); 
+	 // }
+ 
+	 // status = crypto_finish();
+	 // if (status != APP_SUCCESS) {
+	 // 	LOG_INF(APP_ERROR_MESSAGE);
+	 // 	return APP_ERROR;
+	 // }
+ 
+	 return APP_SUCCESS;
+ }
\ No newline at end of file
