Home
home
버블박스
home

보안용 랜덤 숫자 생성 Generate secure random number

한 줄 요약
버블에서 보안 목적을 위한 랜덤 숫자를 생성합니다. 랜덤 바이트를 활용해 암호학적으로 안전한 난수를 생성합니다. This is a plugin that generates random numbers for security purposes at Bubble. It utilizes random bytes to create cryptographically secure random numbers.
컨택 및 제안
bubbleboxerofficial@gmail.com
노코드 마스터로 거듭나기
후원 받은 커피는 더 많은 플러그인을 만드는 원동력이 됩니다.

Core ( 핵심 정보 )

1. Reference

플러그인 페이지
데모 링크
에디터 링크

2. ChangeLog

1.0.0
[KR ver]
랜덤 바이트를 활용한 랜덤 숫자 생성
[Eng ver]
Generate random number by using random byte

3. Why

해당 플러그인은 보안을 목적으로 crypto 모듈 기반으로 랜덤 바이트를 활용해 안전한 난수를 생성합니다. This plugin utilizes the crypto module to generate secure random numbers using random bytes. This improves security.
웹에서 랜덤 숫자를 생성하는 방식은 크게 2가지가 있습니다.
1.
math.random()을 활용한 난수 생성 : math.random은 JS에 기본 내장된 함수로 0과 1 사이의 난수를 생성합니다. 하지만, seed 번호를 알아낸다면 생성된 난수를 예측할 수 있습니다.
2.
crypto.randomByte()를 활용한 난수 생성 : 반면 crypto.randomByte()는 node.js의 crypto 모듈이 제공하는 함수로, 랜덤 바이트를 활용해 난수를 생성합니다. 랜덤 바이트 덕분에 암호학적으로 안전한 난수를 생성합니다.
In web development, there are generally two ways to generate random numbers:
1.
Using Math.random(): This is a built-in JavaScript function that generates random numbers between 0 and 1. However, if the seed number is known, it's possible to predict the generated random numbers.
2.
Using crypto.randomBytes(): This function is provided by the crypto module in Node.js. It generates random numbers using random bytes, ensuring cryptographically secure random numbers. The use of random bytes ensures that the generated numbers are cryptographically secure.
보안에 대한 자세한 설명은 유튜버, 코딩 애플님이 재미있게 정리하셨습니다. (출처 : 유튜브 <코딩애플>)
Detailed explanations about security are amusingly summarized by the YouTuber, 코딩애플. (Source: YouTube <코딩애플>)

4. Actons

a. generate secure andom number ( 보안용 랜덤 숫자 생성 )

구글 시트에 행을 추가합니다. add row in google Sheet
Input
필드
타입
설명
min
number
최소 숫자를 입력합니다. 최소, 최대 숫자를 활용해 범위를 지정합니다. input the minimum number. Utilizing the minimum and maximum numbers, we specify the range.
max
number
최대 숫자를 입력합니다. 최소, 최대 숫자를 활용해 범위를 지정합니다. input the maximum number. Utilizing the minimum and maximum numbers, we specify the range.
Digit
number
자릿수를 입력합니다. enter the number of digits
{ "min" : 1000, "max" : 8000, "Digit" : 4 }
JSON
복사
return
필드
타입
설명
randomString
String
생성된 랜덤 숫자를 str 타입으로 반환합니다. return random number as type of str
randomNumber
number
생성된 랜덤 숫자를 num 타입으로 반환합니다. return random number as type of num
///success { "randomString" : "4563", "randomNumber" : 4563 }
JSON
복사

5. Tutorial

[min] 필드에는 최소 숫자를, [max] 필드에는 최대 숫자를 입력합니다. 그리고 [digit] 필드에는 생성하고자 한 자릿수를 입력합니다. 그러면, 해당 범위 안에서 해당하는 자릿수의 데이터가 생성됩니다. 예를 들어, min을 1000, max를 8000, digit을 4로 입력한다면, 1000에서 8000 자리의 숫자가 랜덤으로 생성됩니다.
In the [min] field, input the minimum number, and in the [max] field, input the maximum number. Then, in the [digit] field, input the number of digits you want to generate. Consequently, a number of the specified digits will be randomly generated within the specified range. For example, if you input min as 1000, max as 8000, and digit as 4, a random number between 1000 and 8000 with 4 digits will be generated.
숫자 생성 시, js의 math.random()이 아니라 node.js의 crpyto 모듈을 활용해 랜덤 바이트로 해당 자릿수 만큼의 숫자를 생성합니다.
When generating numbers, instead of using JavaScript's Math.random(), we utilize Node.js's crypto module to generate random bytes for the specified number of digits.
후원 받은 커피는 더 많은 플러그인과 자료를 만드는 원동력이 됩니다.
버블박스 l BubbleBox
Premium