• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2020, Vol. 42 ›› Issue (10高性能专刊): 1905-1912.

• 高性能计算机系统应用 • 上一篇    

GPU上典型存储器难散列函数的优化

陈虎1,2,韩建国1   

  1. (1.华南理工大学软件学院,广东 广州 510006;2.广东省科技基础条件平台中心,广东 广州 510006)
  • 收稿日期:2020-06-04 修回日期:2020-07-12 接受日期:2020-10-25 出版日期:2020-10-25 发布日期:2020-10-23
  • 基金资助:
    国家自然科学基金联合基金(U1836207);广东省高性能计算重点实验室开放基金(60873120)

Optimization of typical memory-hard hash functions on GPUs

CHEN Hu1,2,HAN Jian-guo1   

  1. (1.School of Software,South China University of Technology,Guangzhou 510006;

    2.Guangdong Science & Technology Infrastructure Center,Guangzhou 510006,China)


  • Received:2020-06-04 Revised:2020-07-12 Accepted:2020-10-25 Online:2020-10-25 Published:2020-10-23

摘要: 由于占用存储器容量大和访存频繁的特点,抗ASIC攻击的存储器难散列函数有可能成为下一代口令散列函数的基础。针对存储器难散列函数的口令恢复问题,基于GPU体系结构的特点提出了性能优化方法:一方面分析和比较了交织存储和顺序存储2种方法的存储器带宽利用率,另一方面使用多个线程完成一个散列函数实例计算,并通过warp混洗指令提升线程间数据交换的性能。基于4线程顺序存储方法,在GPU上优化实现了Scrypt和Argon2d 2种存储器难散列函数,其中Scrypt的性能达到了hashcat软件实现性能的2.03倍。与此同时,还分析了存储器难散列函数中存储器容量增加对性能的影响,指出可执行的线程数减少是影响GPU上存储器难散列函数性能的主要原因。

关键词: 存储器难散列函数, 通用图形处理器, 口令恢复

Abstract: Due to the large memory capacity and frequent memory access, memory-hard hash functions are ASIC-resistance and may become the basis of the next generation password hash algorithms. Aiming at the password recovery problem of the memory-hard hash functions, this paper proposes two optimization methods for these functions based on the features of the GPU architecture. Firstly, two types of memory layout (interleaved and sequential) are analyzed and compared. Secondly, multiple threads are used for one hash function instance with the high-performance warp shuffling instructions on GPUs. Based on the sequential memory layout and corporation of four threads, we optimize two typical memory-hard hash functions (Scrypt and Argon2d) on the GPUs. The performance of Scrypt reaches 203 times the implementation of the hashcat software. At the same time, we also analyze the impact of memory capacity on performance, and point out that the reduction in the number of executable threads is the main reason for significant performance degradation on GPUs.


Key words: memory-hard hash functions, graphic process units(GPUs), password recovery