Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedSolve 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 Check

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions