Node.js
-
#Sequelize 그것이 알고 싶다. Sequelize 이론부터 연결까지 1편Node.js 2023. 11. 19. 16:49
# Sequelize란? Sequelize는 Node.js에서 사용할 수 있는 Promise 패턴 기반의 ORM(Object Relational Mappin) 라이브러리입니다. ORM은 데이터베이스와의 상호작용을 좀 더 추상화하여 개발자가 SQL 쿼리를 직접 작성하지 않고도 데이터베이스를 다룰 수 있게 해줍니다. Sequelize는 주로 관계형 데이터베이스(예: PostgreSQL, MySQL, SQLite 등)와 함께 사용됩니다. Sequelize를 사용하면 자바스크립트로 mysql을 제어할 수 있습니다. # Sequelize 설치 ** 터미널을 열어서 sequelize를 사용하기 위해 아래 3가지 패키지를 명령어로 설치해줍니다. $ npm i sequelize mysql2 $ npm i -D sequ..
-
#Node.js // bcrypt 모듈 암호화 사용 방법을 알아보자Node.js 2023. 11. 16. 23:22
# bcrypt란? hash 함수를 이용해 정보를 암호화 할 수 있도록 해주는 Node.js 패키지가 바로 Bcrypt입니다. # bcrypt의 필요성 암호화 방법에는 여러가지가 있습니다. ** D5 방식의 해시 함수 빠르게 처리되지만 보안 측면에서 취약합니다. MD5와 같은 알고리즘은 더 이상 안전하지 않다고 알려져 있습니다. 해시 충돌이 발생할 가능성이 있어 해킹에 취약합니다. ** SHA 방식의 해시 함수 안전성이 높지만, 가장 큰 단점은 암호화하는데 시간이 많이 걸린다는 단점이 있습니다. 더 안전한 해시 알고리즘인 SHA-256, SHA-512등을 사용할 수 있지만, 계산량이 많아질수록 처리 속도가 느려집니다. ** 공유 메시지(salt)추가 방식 간단한 해시 함수만으로는 보안이 취약할 수 있기 ..