Research Article Open Access

Unveiling the Performance: A Comparative Study of HMAC and RSA Encryption on SHA-512

Louis Leonardo1 and Rojali2
  • 1 Department of Computer Science, BINUS Graduate Program-Master of Computer Science, Bina Nusantara University, Jakarta, Indonesia
  • 2 Department of Computer Science, BINUS Graduate Program-Master of Computer Science, Bina Nusantara University, Jakarta, Indonesia

Abstract

The study evaluates critical operations including token signing, verification, and decoding, as well as data transfer efficiency, utilizing the jsonwebtoken library. By benchmarking these operations, we provide insights into the trade-offs between symmetric (HMAC) and asymmetric (RSA) encryption methods, highlighting their impact on performance and security. The results serve as a guideline for developers to make informed decisions when choosing JWT algorithms for their Node.js applications, balancing security needs and application performance. Our analysis revealed that HMAC-SHA512 consistently outperforms RSA-SHA512 in terms of token creation speed, data transfer efficiency, and token size. Specifically, HMAC-SHA512 demonstrated faster token generation times, achieving rates up to ten times higher than RSA-SHA512, and produced tokens that were 256 bytes smaller on average. Furthermore, HMAC-SHA512 maintained superior data transfer rates, reaching up to 42.601 MB/s, compared to RSA-SHA512's maximum of 9.822 MB/s. Despite RSA-SHA512's robust performance in token verification and decoding, HMAC-SHA512's overall efficiency and consistency make it the preferred choice for applications requiring rapid processing and minimal latency. This study underscores the potential of HMAC-SHA512 to enhance performance in data-intensive environments, highlighting its advantages in speed and reduced data payload.

Journal of Computer Science
Volume 21 No. 12, 2025, 2940-2950

DOI: https://doi.org/10.3844/jcssp.2025.2940.2950

Submitted On: 22 August 2024 Published On: 22 January 2026

How to Cite: Leonardo, L. & Rojali, . (2025). Unveiling the Performance: A Comparative Study of HMAC and RSA Encryption on SHA-512. Journal of Computer Science, 21(12), 2940-2950. https://doi.org/10.3844/jcssp.2025.2940.2950

  • 41 Views
  • 12 Downloads
  • 0 Citations

Download

Keywords

  • JSON Web Token
  • JWT
  • HMAC-SHA512
  • RSA-SHA512
  • NodeJS
  • Encryption Performance
  • Data Transfer