Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Solve using MatLab This problem will deal with prime factorization. Any integer larger than 1 can be decomposed into a product of prime numbers. For
Solve using MatLab
This problem will deal with prime factorization. Any integer larger than 1 can be decomposed into a product of prime numbers. For example 6-2.3 12- 2 2 3 0 235 05-3 5*7 Prime factorization is actually a fundamental part of modern cryptography and code breaking. One technique for encryption is to use a very large number 128 bit ie.2 28 possible combinations) to encrypt a message. This large number is the public key that everyone knows. This number is also the product of two large prime numbers, which are the private key. Once the message has been encrypted, only people who know the two prime numbers can decode the message. Since finding the prime factors of very large numbers requires substantial computation, this is a very secure way to encrypt information. For more details, see: http://en.wikipedia.org/wiki/RSA_(algorithm) Your task is to write a function that determines the prime factors of an integer. Your function should have the following characteristics: Name your function "prime_fact.m". You will use only this function for this assignment in Grader. No other functions will be used The input is a single integer "N". The output is a row vector "prime" that contains each of the prime factors of N So your syntax could look something like: function prime -prime fact(N) You may not use the "isprime", "primes", or "factor" functions Useful functions may include "mod", "rem", and while or for loops Problems Prime Function Time CheckStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started