Convex optimization is explored in this paper to maximize the security against power analysis attacks while minimizing the power and performance overheads for a cryptographic circuit employs a random dynamic voltage and frequency scaling (RDVFS) technique. To realize this optimization goal, firstly, non-convex functions are used for modeling all the critical parameters related to the RDVFS technique to create a non-convex objective function. Subsequently, the non-convex objective function is appropriately converted into a convex objective function in order to grab the global optimum value. By transforming the acquired convex objective function into the Lagrange dual function and using Karush–Kuhn–Tucker (KKT) conditions to solve this optimization problem, the best RDVFS strategy can be uncovered. As shown in the result, after employing convex optimization for a cryptographic circuit with a RDVFS technique, the corresponding figure-of-merit (FOM) is enhanced by 43.4%. Moreover, in comparison with the conventional machine learning technique, the proposed convex optimization technique improves the overall FOM related with RDVFS technique by 17.6% while reducing 85.3% computational time.