Side-Channel analysis poses a significant threat to the security of cryptographic devices. Distance-based clustering methods include K-means and its variants are popularly applied on side-channel analysis in public key cryptography. However, distance-based clustering perform poorly in irregular data distributions. In this paper, we combine density-based clustering methods, such as DBSCAN and OPTICS, with side-channel analysis. In comparison to distance-based clustering methods, density-based methods are better suited for handling irregular data distributions and demonstrate greater robustness against noise. With density-based clustering methods, We successfully recover the operations on power traces with accuracy of 100% on both ECC-Card and ECC-FPGA, while the $\displaystyle \max$ accuracy of distance-based clustering methods is only 68.66% on the two datasets.